Skip to content

[CDRIVER-5537] A Signed Release Archive + Augmented SBOM Publication #1637

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 11 commits into from
Jun 11, 2024

Conversation

vector-of-bool
Copy link
Contributor

Summary

This changeset re-introduces a release archive process as part of the release process. This is significantly simplified from the old makedist archive, and is mostly just an archive produced by Git with some additional goodies, with more to be added in later changes.

What's Included

  • New Earthly targets are added to automate aspects of the release process, including generation of the source archive and signing thereof. Currently, this creates an unfortunate split of the release tools between the c-driver-tools repo and this repository, but it is anticipated that future changes will progressively migrate additional components from the c-driver-tools repo back into the main source repository.
  • More documentation has been added on using Earthly and the Earthfile targets, hopefully to accelerate future onboarding and troubleshooting for those that don't work with Earthly on a daily basis. Using separate documentation from the inline comments in the Earthfile allows for far more comprehensive descriptions of what is possible.
  • A new semi-automated step has been introduced in the release process that utilizes the new Earthly targets to attach additional artifacts to the GitHub release for the C driver. This includes the new release archive, as well as a detached PGP signature, satisfying the requirements of CDRIVER-5537.
  • In addition to the source repository, the release archive also includes the augmented SBOM, which is downloaded on-the fly as part of the archive generation. This will satisfy the requirements of CDRIVER-5535.

Other Notes

  • This PR builds upon the [CDRIVER-5535] Add an +sbom-download target for getting the augmented SBOM #1629 changes, so its commits are included in the commit history here, but can be ignored.
  • The choice of Earthly was primarily made to just extend "what we already have" and to ensure isolation and uniformity of execution across different systems, but it was found that Earthly's secret-handling functionality is extremely convenient for these processes!
  • No new EVG tasks are defined.

- +release-archive generates an archive of the repository that contains
  the augmented SBOM downloaded from Silk
- +sign-file can sign arbitrary files
- +signed-release generates release artifacts using +release-archive
  and +sign-file to create a release archive and detached signature.
Copy link
Contributor

@rcsanchez97 rcsanchez97 left a comment

Choose a reason for hiding this comment

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

LGTM, w/ some small tweaks.

Earthfile Outdated

# sign-file :
# Sign an arbitrary file. This uses internal MongoDB tools and requires authentication
# to be used access them. (Refer to dev docs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# to be used access them. (Refer to dev docs)
# to be used to access them. (Refer to dev docs)

.. option:: --branch <branch>

**Required**. Specifies the branch of the repository from which we are
requested an SBOM.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "are requesting" or "have requested"?

.. option:: --file <filepath>

**Required**. Specify a path to a file (on the host) to be signed. This
file must be a descendent of the directory that contains the ``Earthfile``
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
file must be a descendent of the directory that contains the ``Earthfile``
file must be a descendant of the directory that contains the ``Earthfile``

Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

I like the approach to sign a (simpler) archive rather than signing a tag.

Left suggestion to ensure the tarball has the correct VERSION_CURRENT file.

the :any:`+signed-release` target. Let `$BRANCH` be the name of the Git branch
from which the release is being made::

$ ./tools/earthly.sh --artifact +signed-release/dist dist --branch=$BRANCH --version=$NEW_VERSION
Copy link
Collaborator

Choose a reason for hiding this comment

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

This may result in a tarball on a commit after the tag. The post_release_bump step before adds a commit to update VERSION_CURRENT.

Consider having the +signed-release target also do a git checkout to the NEW_VERSION to ensure the tarball is built with the correct VERSION_CURRENT file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've modified the workflow to archive the tagged version rather than the branch revision, and renamed some of the parameters as appropriate.

@vector-of-bool vector-of-bool requested a review from kevinAlbs June 11, 2024 19:23
@vector-of-bool vector-of-bool merged commit 2e2aa1c into mongodb:master Jun 11, 2024
34 of 36 checks passed
@vector-of-bool vector-of-bool deleted the release-archive.2 branch June 12, 2024 19:35
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