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

Add option to build sam with specified manifest file. #25

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kalpaitch
Copy link
Contributor

We have an issue where we are building multiple components from the same repository, all with their own template files and package.json files.

The current build-action supports specifying the template file, but not the manifest.

Please let me know what the process is for raising this request, but I thought a PR with an example of the changes requested could help :)

@kalpaitch
Copy link
Contributor Author

Testing on this build, one component running with --manifest and one running without, both passing build stage https://github.com/govuk-one-login/onboarding-self-service-experience/actions/runs/8018686483/job/21905082605?pr=636

@@ -71,7 +74,7 @@ runs:
env:
OS: ${{ runner.os }}
CACHE_NAME: ${{ inputs.cache-name }}
HASH: ${{ hashFiles(inputs.template || '**/template.y*ml', inputs.source-dir) }}
HASH: ${{ hashFiles(inputs.template || '**/template.y*ml', inputs.source-dir, inputs.manifest) }}

Choose a reason for hiding this comment

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

How confident are we that when manifest is not provided that this results in the same hash result as the original list of inputs? Do we have a test for this?

Copy link
Contributor Author

@kalpaitch kalpaitch Feb 28, 2024

Choose a reason for hiding this comment

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

Assuming all non-required inputs are empty this hash will not produce the same result as before, hashFiles will evaluate and hash empty inputs as empty strings, this will essentially be a cache busting change. Is this what you're asking?

Choose a reason for hiding this comment

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

Sorry @kalpaitch, my question could've been phrased more clearly 😓 Before/after this change is merged, will an existing consumer of the action see the same hash for a given set of input files, assuming they don't populate the manifest? I'm trying to work out whether the build artifacts are still effectively hermetic regardless of which version of the action a team is using to generate the hash.

Copy link
Contributor Author

@kalpaitch kalpaitch Apr 16, 2024

Choose a reason for hiding this comment

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

As I read the documentation, the answer would be no @pcornish

The addition of an extra parameter, be it empty or not, will change the hash. From my understanding this would be a cache busting upgrade, do you think this an issue?

@beca-galliano beca-galliano marked this pull request as draft October 29, 2024 10:28
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.

2 participants