Skip to content

Add publication time to registry package release metadata #6407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Apr 11, 2023

Motivation:
Registry should have information about how a package was published. This includes who published it, who signed it, and when it was published.

  • "Who published the package release?": this is metadata.author, which is already defined in the metadata JSON schema.
  • "Who signed the package release?": this can be extracted from the signing certificate if signed (requires rdar://107483043 and will be done in separate PR)
  • "When was the release published?": added in this PR

rdar://106674475

Modifications:

  • Add originalPublicationTime to user-provided metadata during publication
  • Add publishedAt to registry's package release metadata response
  • Update registry API spec

Motivation:
Registry should have information about how a package was published. This includes who published it, who signed it, and when it was published.
 - "Who published the package release?": this is `metadata.author`, which is already defined in the metadata JSON schema.
 - "Who signed the package release?": this can be extracted from the signing certificate if signed (requires rdar://107483043 and will be done in separate PR)
 - "When was the release published?": added in this PR

rdar://106674475

Modifications:
- Add `originalPublicationTime` to user-provided metadata during publication
- Add `publishedAt` to registry's package release metadata response
- Update registry API spec
| `author` | [Author](#author-type) | Author of the package release. | |
| `description` | String | A description of the package release. | |
| `licenseURL` | String | URL of the package release's license document. | |
| `originalPublicationTime` | String | Original publication time of the package release in [ISO 8601] format. This can be set if the package release was previously published elsewhere.<br>A registry should record the publication time independently and include it as `publishedAt` in the [package release metadata response](#42-fetch-information-about-a-package-release). <br>In case both `originalPublicationTime` and `publishedAt` are set, `originalPublicationTime` should be used. | |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new

| `version` | String | The package release version number. | ✓ |
| `resources` | Array | The resources available for the release. | ✓ |
| `metadata` | Object | Additional information about the release. | ✓ |
| `publishedAt` | String | The [ISO 8601]-formatted datetime string of when the package release was published, as recorded by the registry. See related [`originalPublicationTime`](#appendix-b---package-release-metadata-json-schema) in `metadata`. | |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new

@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 11, 2023

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 11, 2023

@swift-ci please smoke test Linux

1 similar comment
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 11, 2023

@swift-ci please smoke test Linux

@neonichu
Copy link
Contributor

Can we also add this to Sources/PackageMetadata/PackageMetadata.swift?

@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 11, 2023

@neonichu Added to PackageMetadata.swift: 73990fb

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 11, 2023

@swift-ci please test Windows platform

}

// FIXME: This matches the current implementation, but we may want be smarter about it?
private func guessReadMeURL(baseURL: URL, defaultBranch: String) -> URL {
return baseURL.appendingPathComponent("raw").appendingPathComponent(defaultBranch).appendingPathComponent("README.md")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😿

}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should remove readmeURL from the API and let the clients figure it out using their own logic.

@yim-lee yim-lee merged commit aadb688 into swiftlang:main Apr 11, 2023
@yim-lee yim-lee deleted the registry-version-publishedat branch April 11, 2023 21:51
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Apr 11, 2023
…6407)

* Add publication time to registry package release metadata

Motivation:
Registry should have information about how a package was published. This includes who published it, who signed it, and when it was published.
 - "Who published the package release?": this is `metadata.author`, which is already defined in the metadata JSON schema.
 - "Who signed the package release?": this can be extracted from the signing certificate if signed (requires rdar://107483043 and will be done in separate PR)
 - "When was the release published?": added in this PR

rdar://106674475

Modifications:
- Add `originalPublicationTime` to user-provided metadata during publication
- Add `publishedAt` to registry's package release metadata response
- Update registry API spec

* Add publishedAt to PackageSearchClient
yim-lee added a commit that referenced this pull request Apr 12, 2023
)

* Add publication time to registry package release metadata

Motivation:
Registry should have information about how a package was published. This includes who published it, who signed it, and when it was published.
 - "Who published the package release?": this is `metadata.author`, which is already defined in the metadata JSON schema.
 - "Who signed the package release?": this can be extracted from the signing certificate if signed (requires rdar://107483043 and will be done in separate PR)
 - "When was the release published?": added in this PR

rdar://106674475

Modifications:
- Add `originalPublicationTime` to user-provided metadata during publication
- Add `publishedAt` to registry's package release metadata response
- Update registry API spec

* Add publishedAt to PackageSearchClient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants