Skip to content

ci(format): Fail Format Code when it had to format code - #6824

Open
runningcode wants to merge 1 commit into
mainfrom
no/format-code-fail
Open

runningcode wants to merge 1 commit into
mainfrom
no/format-code-fail

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

Format Code now fails when it had to format code. It still pushes the formatting commit as before, then exits 1 with an error that says to pull that commit and push again.

💡 Motivation and Context

Until now, Format Code pushed a fix and then passed, so a PR with unformatted code showed a green check. That means the job can't be made a required check: it never fails on the problem it exists to catch.

We want automated review where LLM reviewers never comment on what a formatter decides, and that only works if formatting is enforced.

The push uses GITHUB_TOKEN, and pushes made with it don't start workflow runs. So the formatting commit gets no checks until the author pushes again, which is how it already worked; the error message now says so.

💚 How did you test it?

bash -n on the script. The failing path only runs on a PR with unformatted code.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Make Format Code a required check in the main ruleset. Today only Build Job ubuntu-latest and enforce-license-compliance are required.

🤖 Generated with Claude Code

#skip-changelog

Format Code pushed a formatting commit and then passed, so unformatted
code showed a green check and the job could not gate a merge. It now
fails after pushing the fix. The push uses GITHUB_TOKEN, which starts no
workflows, so the formatting commit is checked once the author pushes
again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 327bca8.

The model rated this change low. It was raised to medium because:

  • R6: build or release configuration changed: scripts/commit-formatted-code.sh
  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Dec 1, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.66.0 (1) release

⚙️ sentry-android Build Distribution Settings

@romtsn

romtsn commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

can we make it start workflow runs? 👀 I believe we solved it in the main sentry repo with frontend/backend formatting job somehow

@runningcode
runningcode marked this pull request as ready for review December 1, 2026 16:21
@runningcode
runningcode requested review from a team and adinauer as code owners December 1, 2026 16:21
@runningcode
runningcode requested review from markushi and romtsn and removed request for a team December 1, 2026 16:21
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026

This branch has not been deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants