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

Add a check for pending graphql generated items #9726

Closed
FelixMalfait opened this issue Jan 17, 2025 · 5 comments · Fixed by #9742
Closed

Add a check for pending graphql generated items #9726

FelixMalfait opened this issue Jan 17, 2025 · 5 comments · Fixed by #9742

Comments

@FelixMalfait
Copy link
Member

Problem: people forget to run npx nx run twenty-front:graphql:generate and npx nx run twenty-front:graphql:generate --configuration=metadata. So sometimes their changes will end up in a subsequent unrelated PR

We had a similar problem for TypeORM which we solved elegantly: https://github.com/twentyhq/twenty/blob/main/.github/workflows/ci-server.yaml#L82

We should do the same for graphql generation

@yadavshubham01
Copy link
Contributor

Hey @FelixMalfait , should I try working on this issue?

@yadavshubham01
Copy link
Contributor

@FelixMalfait Let me tell you how i approach this issue :-
I'm adding an automated check in the CI pipeline to ensure no uncommitted changes are introduced. This involves creating a script that runs the necessary GraphQL generation commands (npx nx run twenty-front:graphql:generate and npx nx run twenty-front:graphql:generate --configuration=metadata) and then verifies if any files have uncommitted changes. If changes are detected, the CI process will fail, prompting the developer to regenerate and commit the updates. This approach is similar to how we handled the TypeORM issue and ensures consistency while preventing unrelated changes in future PRs

@yadavshubham01
Copy link
Contributor

hey @FelixMalfait assign this issue ??

@FelixMalfait
Copy link
Member Author

@yadavshubham01 feel free to raise a PR! Make sure to test it well before

@yadavshubham01
Copy link
Contributor

@FelixMalfait thanks

charlesBochet added a commit that referenced this issue Jan 21, 2025
This pull request addresses the issue of ensuring that npx nx run
twenty-front:graphql:generate and npx nx run
twenty-front:graphql:generate --configuration=metadata commands are run
to generate the necessary GraphQL files. This prevents changes from
being missed and ending up in subsequent unrelated PRs.

Changes:
Added a step in the ci-server.yml workflow to check for pending GraphQL
generation.
If any GraphQL changes are detected, the CI will fail, and an error
message will be displayed instructing the developer to run the necessary
commands and commit the changes.
This approach is similar to the existing TypeORM migration check and
helps maintain consistency and correctness in the codebase.

Issue Resolved: #9726

---------

Co-authored-by: Charles Bochet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants