- 
                Notifications
    You must be signed in to change notification settings 
- Fork 30
chore: exclude auto-generated OpenAPI file and GitHub workflows from YAML formatting #741
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
chore: exclude auto-generated OpenAPI file and GitHub workflows from YAML formatting #741
Conversation
…YAML formatting Co-Authored-By: AJ Steers <aj@airbyte.io>
| Original prompt from AJ Steers | 
| 🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically: 
 Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options: 
 | 
There was a problem hiding this 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 configures Prettier to exclude auto-generated OpenAPI specifications and GitHub workflow files from YAML formatting to prevent unnecessary formatting changes in future PRs.
- Adds exclusion patterns to .prettierignorefor auto-generated OpenAPI spec file
- Excludes all YAML files in the .github/directory from formatting
- Maintains formatting capabilities for legitimate YAML files while protecting auto-generated content
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1756487044-formatting-fixes-and-exclusions#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1756487044-formatting-fixes-and-exclusionsHelpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR: 
 | 
| 📝 WalkthroughWalkthroughAdds new ignore patterns to .prettierignore: one for an auto-generated OpenAPI file and another for GitHub workflow YAML files. All changes are additive. Changes
 Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
 Suggested labels
 Suggested reviewers
 ✨ Finishing Touches🧪 Generate unit tests
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 
 SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type  Other keywords and placeholders
 CodeRabbit Configuration File ( | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.prettierignore (3)
5-6: LGTM on excluding the generated OpenAPI spec.This is a sensible guardrail to prevent churn from formatters. As a follow-up, would you like to also mark this file as generated for GitHub’s UI with a .gitattributes entry (e.g., “airbyte_cdk/manifest_server/openapi.yaml linguist-generated”) so diffs are collapsed by default, and/or add a generator header comment in the file itself to signal “do not edit”? wdyt?
8-10: Scope GitHub YAML ignore to workflows only?Ignoring all YAML in .github may also skip formatting for issue templates, dependabot, release-please, etc. Would narrowing to workflows help (and reduce surprises), e.g. below? wdyt?
-.github/**/*.yml -.github/**/*.yaml +.github/workflows/**/*.yml +.github/workflows/**/*.yaml
5-10: Minor: prefer separate commands for write vs. check.To avoid accidental writes during CI checks and for clarity, would you split the suggested command into two invocations (one for write locally, one for check in CI)? For example:
- Local fix: npx prettier --write "**/*.{yaml,yml}"
- CI gate: npx prettier --check "**/*.{yaml,yml}"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
- .prettierignore(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-11-15T00:59:08.154Z
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/cli/source_declarative_manifest/spec.json:9-15
Timestamp: 2024-11-15T00:59:08.154Z
Learning: When code in `airbyte_cdk/cli/source_declarative_manifest/` is being imported from another repository, avoid suggesting modifications to it during the import process.
Applied to files:
- .prettierignore
📚 Learning: 2024-12-11T16:34:46.319Z
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the `declarative_component_schema.py` file is auto-generated from `declarative_component_schema.yaml` and should be ignored in the recommended reviewing order.
Applied to files:
- .prettierignore
📚 Learning: 2024-12-11T16:34:46.319Z
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, ignore all `__init__.py` files when providing a recommended reviewing order.
Applied to files:
- .prettierignore
📚 Learning: 2024-11-15T01:04:21.272Z
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/cli/source_declarative_manifest/_run.py:62-65
Timestamp: 2024-11-15T01:04:21.272Z
Learning: The files in `airbyte_cdk/cli/source_declarative_manifest/`, including `_run.py`, are imported from another repository, and changes to these files should be minimized or avoided when possible to maintain consistency.
Applied to files:
- .prettierignore
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: SDM Docker Image Build
- GitHub Check: Manifest Server Docker Image Build
- GitHub Check: Pytest (Fast)
- GitHub Check: Analyze (python)
🔇 Additional comments (1)
.prettierignore (1)
5-10: Verify if other YAML format/check tools exist before updating ignore patternsI didn’t find pre-commit, yamllint, or actionlint configs in the repo—Prettier appears to be the only YAML formatter here. Could you confirm whether any CI or local YAML linters/formatters need these ignore patterns mirrored, or should we just expand .prettierignore to cover all YAML files? wdyt?
chore: exclude auto-generated OpenAPI file and GitHub workflows from YAML formatting
Summary
This PR configures Prettier to exclude auto-generated files from YAML formatting to prevent unnecessary formatting changes in future PRs. Specifically excludes:
airbyte_cdk/manifest_server/openapi.yaml(auto-generated OpenAPI spec file).github/directory (workflow configurations)The exclusions were tested and confirmed working - Prettier now reports "All matched files use Prettier code style!" indicating the excluded files are properly ignored.
Review & Testing Checklist for Human
npx prettier --write "**/*.{yaml,yml}" --checkto confirm excluded files are not processedairbyte_cdk/manifest_server/openapi.yamlremains unchanged when running formattersNotes
poetry run poe format-checkcommand still reported formatting issues, suggesting there may be other formatting tools involved beyond PrettierSummary by CodeRabbit