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

Fix asset rebuilds & dependencies #1157

Merged
merged 2 commits into from
Nov 26, 2024
Merged

Fix asset rebuilds & dependencies #1157

merged 2 commits into from
Nov 26, 2024

Conversation

danielrbradley
Copy link
Member

@danielrbradley danielrbradley commented Nov 26, 2024

Follow-up to #1151
Fixes #1157

Fix tfgen makefile dependencies

  • Rebuild the binary if any go source files change (use a wildcard here rather than limiting to resource.go).
  • Rebuild the binary if upstream changes in any way.

Use make --touch for restoring progress

When we restore the make progress as an asset it had the timestamps of when the files were created in the original job, as expected. However, the source files had been freshly checked out. Therefore, any file that has already been built in a previous job and restored in a subsequent job was older than the freshly checked out files and was rebuilt, causing longer runtimes.

  • Any job that depends on the prerequisites job (and restores its artifacts) should touch the provider and schema targets.
  • Any job that depends on the build_sdk job matrix should touch the provider, schema and build_[language] targets.

- Rebuild the binary if any go source files change (use a wildcard here rather than limiting to resource.go).
- Rebuild the binary if upstream changes in any way.
When we restore the make progress as an asset it had the timestamps of when the files were created in the original job, as expected. However, the source files had been freshly checked out. Therefore, any file that has already been built in a previous job and restored in a subsequent job was older than the freshly checked out files and was rebuilt, causing longer runtimes.

- Any job that depends on the `prerequisites` job (and restores its artifacts) should touch the `provider` and `schema` targets.
- Any job that depends on the `build_sdk` job matrix should touch the `provider`, `schema` and `build_[language]` targets.
@danielrbradley danielrbradley requested a review from a team November 26, 2024 18:03
@danielrbradley danielrbradley self-assigned this Nov 26, 2024
Copy link
Contributor

@blampe blampe left a comment

Choose a reason for hiding this comment

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

Very clean.

Comment on lines -51 to -54
uses: actions/download-artifact@v4
with:
name: prerequisites.make
path: .make
Copy link
Contributor

Choose a reason for hiding this comment

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

Fewer dependent GitHub actions is always a good thing!

@danielrbradley danielrbradley added this pull request to the merge queue Nov 26, 2024
Merged via the queue into master with commit 0fc040f Nov 26, 2024
6 checks passed
@danielrbradley danielrbradley deleted the fix-deps branch November 26, 2024 21:44
danielrbradley added a commit to pulumi/pulumi-aws that referenced this pull request Nov 27, 2024
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