Skip to content

fix(ci): fix the schema bumping path issue#134

Open
kenzoengineer wants to merge 3 commits into
mainfrom
kjiang/bump-schema-fix
Open

fix(ci): fix the schema bumping path issue#134
kenzoengineer wants to merge 3 commits into
mainfrom
kjiang/bump-schema-fix

Conversation

@kenzoengineer
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1b65a7f. Configure here.

Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
Comment on lines 205 to 208
name: Bump SHA in automator
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/bump-sha.yml
secrets: inherit

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Removing the if condition on the bump-sha job causes it to run on pull requests and non-main branches, incorrectly updating a downstream repository with non-production commit SHAs.
Severity: HIGH

Suggested Fix

Re-introduce a condition to ensure the bump-sha job only runs on pushes to the main branch. The original condition if: github.ref == 'refs/heads/main' would work. A more explicit condition is if: github.event_name == 'push' && github.ref == 'refs/heads/main'.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/main.yml#L205-L208

Potential issue: The removal of the `if: github.ref == 'refs/heads/main'` condition on
the `bump-sha` job causes it to execute on unintended triggers. The workflow is
configured to run on `pull_request` events and pushes to branches like `test-me-*` and
`release/**`. Without the conditional, the `bump-sha` job will execute in these
scenarios, not just on pushes to `main`. This will cause the `bump_sha.py` script to be
called with a `github.sha` from a feature branch, release branch, or unmerged PR,
leading to incorrect, non-production SHAs being pushed to the `sentry-options-automator`
repository, potentially causing incorrect configurations to be deployed.

Also affects:

  • .github/workflows/bump-sha.yml:24

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

aware of this, purely for testing.

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.

1 participant