Skip to content
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

release: add provenance with GitHub actions #3938

Merged
merged 12 commits into from
Apr 26, 2024
Merged

release: add provenance with GitHub actions #3938

merged 12 commits into from
Apr 26, 2024

Conversation

v1v
Copy link
Member

@v1v v1v commented Mar 25, 2024

What does this pull request do?

Run the release steps partially for main - to validate things work smoothly before the release. It skips the below steps:

  • npm publish
  • github release creation

Further details

Use the GitHub provenance in this project as explained in https://docs.npmjs.com/generating-provenance-statements

## Test

I created a test feature branch and https://github.com/elastic/apm-agent-nodejs/actions/runs/8819809747 is now running in dry-run mode:

.github/workflows/release.yml Outdated Show resolved Hide resolved
@v1v v1v changed the title Provenance release: add provenance with GitHub actions Apr 12, 2024
@v1v v1v marked this pull request as ready for review April 22, 2024 15:52
@v1v v1v requested review from a team April 22, 2024 15:52
reakaleek
reakaleek previously approved these changes Apr 22, 2024
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.ci/Makefile Outdated
docker build -t $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):$(AGENT_VERSION) \
--build-arg AGENT_DIR=$(DIST_DIR) ..

push-docker: build-docker
@echo "Obsoleted, use GitHub actions"
Copy link
Member

Choose a reason for hiding this comment

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

Moving away from the push-docker.sh script drops support for only sometimes applying the "latest" Docker tag to an image. This handling was used so that we could use the same push-docker.sh script for the current latest major releases (4.x) and for the 3.x maintenance branch.

I suppose this is fine, given that we won't add provenance support to the 3.x branch. At some point if/when tehre is a 5.x major, then we'd need to make sure that a maintenance 4.x release does NOT push the "latest" Docker tag.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shall we move this topic to a follow-up?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this PR doesn't need to handle this.

.ci/Makefile Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
Co-authored-by: Trent Mick <trent.mick@elastic.co>
@v1v v1v requested a review from trentm April 24, 2024 16:15
@v1v v1v self-assigned this Apr 24, 2024
.ci/Makefile Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
- name: Attest Lambda layer zip
uses: github-early-access/generate-build-provenance@main
with:
subject-path: "${{ github.workspace }}/build/aws/elastic-apm-node-lambda-layer-*.zip"
Copy link
Member

Choose a reason for hiding this comment

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

Q: Do we really want to (a) publish attestations (this goes on a public immutable ledger of some sort, IIUC), and (b) docker build and push for every commit to main? My concern is that this is very wasteful.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm probably biased, but I prefer to run the release on the main branch with a dry-run or a subset of the jobs; this can detect any breaking changes in workflows.

Therefore, I enabled the provenance for those artefacts - I see it might be useful, and those artefacts will be available and with their attestations.

From the disc space, it should be ok, there is no limitation in our elastic docker registry

@v1v v1v merged commit 8b8d1fe into main Apr 26, 2024
23 checks passed
@v1v v1v deleted the provenance branch April 26, 2024 11:34
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.

None yet

3 participants