Skip to content

Add fail_on_generated_edits helper#16

Merged
AlvaroBrey merged 2 commits into
mainfrom
danger-generated-file-guard
Jun 15, 2026
Merged

Add fail_on_generated_edits helper#16
AlvaroBrey merged 2 commits into
mainfrom
danger-generated-file-guard

Conversation

@AlvaroBrey

@AlvaroBrey AlvaroBrey commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adds a helper that will be called from codegen consumer repos to prevent modification of generated files

@AlvaroBrey AlvaroBrey self-assigned this Jun 15, 2026
Dormant helper (not auto-invoked): repos call it after import_dangerfile with the
generated file/dir path(s) to fail PRs that hand-edit generated files, bypassed by the
pr:auto_codegen label. Used by purchases-{js,android,ios} for their error-code files.
@AlvaroBrey AlvaroBrey force-pushed the danger-generated-file-guard branch from 29b73a2 to e8e6c5f Compare June 15, 2026 09:36
@AlvaroBrey AlvaroBrey requested a review from a team June 15, 2026 09:39
@AlvaroBrey AlvaroBrey marked this pull request as ready for review June 15, 2026 09:39

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@AlvaroBrey AlvaroBrey merged commit d1be8e4 into main Jun 15, 2026
@AlvaroBrey AlvaroBrey deleted the danger-generated-file-guard branch June 15, 2026 09:44
AlvaroBrey added a commit to RevenueCat/purchases-js that referenced this pull request Jun 15, 2026
- Adds a Danger check to prevent modification of autogenerated files
from
[purchases-error-codes](https://github.com/RevenueCat/purchases-error-codes).
Calls a function defined in
[RevenueCat/Dangerfile](RevenueCat/Dangerfile#16)
- Bumps the [shared
orb](RevenueCat/sdks-circleci-orb#68) to get the
proper labels on the generated PRs

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> CI and Danger policy only; no runtime SDK or auth/data behavior
changes.
> 
> **Overview**
> Adds a **Danger** guard that fails PRs that touch files under
`src/generated/` (e.g. autogenerated `error-codes.ts` from
purchases-error-codes), using the shared `fail_on_generated_edits`
helper from **RevenueCat/Dangerfile**.
> 
> Bumps the **sdks-common-config** CircleCI orb from `3.21.0` to
`3.21.1` so automated `update_error_codes` PRs get the correct labels.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
680579e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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