Skip to content

ci: pin slsa-github-generator to commit SHA#7363

Open
oindrilakha12-ui wants to merge 3 commits intokarmada-io:masterfrom
oindrilakha12-ui:fix-slsa-sha-pinning
Open

ci: pin slsa-github-generator to commit SHA#7363
oindrilakha12-ui wants to merge 3 commits intokarmada-io:masterfrom
oindrilakha12-ui:fix-slsa-sha-pinning

Conversation

@oindrilakha12-ui
Copy link
Copy Markdown

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
This PR updates the slsa-framework/slsa-github-generator GitHub Action in the release workflow to be pinned to a specific commit SHA (f7dd8c54c2067bafc12ca7a55595d5ee9b75204a, which corresponds to the v2.1.0 tag) instead of referencing it by a tag. This helps enhance supply chain security by ensuring the action's integrity, and resolves the tracking issue for SHA pinning support in slsa-github-generator.

Which issue(s) this PR fixes:
Fixes #7337

Special notes for your reviewer:
The pinned SHA f7dd8c54c2067bafc12ca7a55595d5ee9b75204a is verified to be the commit for the v2.1.0 tag of slsa-framework/slsa-github-generator. The comments stating it "Must be referenced by a tag" have been removed accordingly.

Does this PR introduce a user-facing change?:

NONE

Copilot AI review requested due to automatic review settings April 4, 2026 07:38
@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 4, 2026
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@karmada-bot
Copy link
Copy Markdown
Contributor

Welcome @oindrilakha12-ui! It looks like this is your first PR to karmada-io/karmada 🎉

@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR pins the slsa-framework/slsa-github-generator GitHub Action to a specific commit SHA (f7dd8c54c2067bafc12ca7a55595d5ee9b75204a, corresponding to v2.1.0) instead of using the tag reference, improving supply chain security by ensuring action integrity.

Changes:

  • Updated 4 workflow jobs (cli-provenance, crds-provenance, charts-provenance, and sbom-provenance) to reference the slsa-github-generator action using a commit SHA instead of the v2.1.0 tag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
@@ -71,7 +71,7 @@ jobs:
id-token: write # Needed for provenance signing and ID
contents: write # Needed for release uploads
# Must be referenced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The PR description states "The comments stating it 'Must be referenced by a tag' have been removed accordingly," but this comment is still present in the code at line 73 and other locations (115, 154, 197). Since the reference has been changed from a tag to a commit SHA, this comment is now misleading and should either be removed or updated to reflect the current implementation.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release.yml Outdated
@@ -113,7 +113,7 @@ jobs:
id-token: write # Needed for provenance signing and ID
contents: write # Needed for release uploads
# Must be referenced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The comment "Must be referenced by a tag" is now outdated since the action is being pinned to a commit SHA. This comment should be removed or updated to reflect the change.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release.yml Outdated
@@ -152,7 +152,7 @@ jobs:
id-token: write # Needed for provenance signing and ID
contents: write # Needed for release uploads
# Must be referenced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The comment "Must be referenced by a tag" is now outdated since the action is being pinned to a commit SHA. This comment should be removed or updated to reflect the change.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/release.yml Outdated
@@ -195,7 +195,7 @@ jobs:
id-token: write # Needed for provenance signing and ID
contents: write # Needed for release uploads
# Must be referenced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The comment "Must be referenced by a tag" is now outdated since the action is being pinned to a commit SHA. This comment should be removed or updated to reflect the change.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 4, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.04%. Comparing base (3424bc7) to head (1052f7c).
⚠️ Report is 88 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7363   +/-   ##
=======================================
  Coverage   42.03%   42.04%           
=======================================
  Files         874      874           
  Lines       53551    53544    -7     
=======================================
+ Hits        22511    22512    +1     
+ Misses      29349    29344    -5     
+ Partials     1691     1688    -3     
Flag Coverage Δ
unittests 42.04% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Oindrila Khan <oindrilakha12@gmail.com>
@karmada-bot karmada-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 4, 2026
…tion

The previous fix changed the condition from:
  condition.LastTransitionTime.After(lastTransitionTime)
to:
  !condition.LastTransitionTime.Time.Before(lastTransitionTime.Truncate(time.Second))

This introduced a regression: when WaitKarmadaReady is called with the
current LastTransitionTime (from GetLastTransitionTime) of an already-Ready
instance, the >= comparison (from !Before) would return true immediately
without waiting for the operator to complete a new reconciliation cycle.

Fix: require the new LastTransitionTime to be strictly in the next second
or later by checking:
  !condition.LastTransitionTime.Time.Before(lastTransitionTime.Truncate(time.Second).Add(time.Second))

This ensures that WaitKarmadaReady always waits for a genuinely new
Ready=True condition that was set by the operator AFTER the spec update,
while also handling the sub-second precision issue with time.Now().
@karmada-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign liangyuanpeng, xishanyongye-chang for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track SHA pinning support for slsa-github-generator

4 participants