Skip to content

Infrastructure, Claude Code, and YAML Linting#520

Merged
chrisaddy merged 2 commits intomasterfrom
yaml-lint
May 17, 2025
Merged

Infrastructure, Claude Code, and YAML Linting#520
chrisaddy merged 2 commits intomasterfrom
yaml-lint

Conversation

@chrisaddy
Copy link
Copy Markdown
Collaborator

@chrisaddy chrisaddy commented May 15, 2025

This pull request introduces significant updates to the project, focusing on infrastructure setup, workflow enhancements, and configuration improvements. The changes include adding a Pulumi-based infrastructure management system, updating GitHub workflows for quality and testing, and enhancing various project configurations to support new tools and tasks.

Infrastructure Setup

  • Added Pulumi-based infrastructure for managing cloud resources, including cloud_run.py for a Cloud Run service, project.py for GCP project configuration, and topics.py for Pub/Sub topics. These files define services, accounts, and scheduled jobs for the datamanager service. (infrastructure/cloud_run.py [1] infrastructure/project.py [2] infrastructure/topics.py [3]
  • Introduced a Pulumi.yaml file to describe the infrastructure project and a pyproject.toml file for Python dependencies required by Pulumi. (infrastructure/Pulumi.yaml [1] infrastructure/pyproject.toml [2]
  • Updated Python version to 3.13 for the infrastructure project. (infrastructure/.python-version infrastructure/.python-versionR1)

Workflow Enhancements

  • Added new GitHub workflows for code quality checks (quality.yaml), stale issue management (stale.yaml), and test/coverage checks (test.yaml). These workflows improve automation and project hygiene. (.github/workflows/quality.yaml [1] .github/workflows/stale.yaml [2] .github/workflows/test.yaml [3]
  • Updated stale issue and PR messages to use a more readable multi-line format. (.github/workflows/stale.yaml .github/workflows/stale.yamlL16-R22)

Configuration Improvements

  • Enhanced .mise.toml with new tasks for linting and managing cloud infrastructure, including a yamllint task and a Pulumi-based infrastructure:up task. (.mise.toml .mise.tomlR67-R81)
  • Updated .flox/env/manifest.toml to include new dependencies for Pulumi and YAML linting tools. (.flox/env/manifest.toml .flox/env/manifest.tomlL4-L18)

Documentation and Guidelines

  • Added CLAUDE.md to document code style guidelines, GitHub issue creation workflows, and the use of mise tasks for running tests, linting, and formatting. (CLAUDE.md CLAUDE.mdR1-R30)

Permissions and Pre-commit Configurations

  • Updated .claude/settings.local.json to define permissions for various Bash commands and web fetches. (.claude/settings.local.json .claude/settings.local.jsonR1-R23)
  • Added a placeholder configuration for pre-commit hooks in .pre-commit-config.yaml. (.pre-commit-config.yaml .pre-commit-config.yamlR1)

@chrisaddy chrisaddy requested a review from forstmeier May 15, 2025 05:28
@chrisaddy chrisaddy self-assigned this May 15, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2025

Warning

Rate limit exceeded

@chrisaddy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 34 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between cc54f82 and 18a8262.

⛔ Files ignored due to path filters (2)
  • .flox/env/manifest.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • .claude/settings.local.json (1 hunks)
  • .flox/env/manifest.toml (1 hunks)
  • .github/workflows/quality.yaml (2 hunks)
  • .github/workflows/stale.yaml (2 hunks)
  • .github/workflows/test.yaml (1 hunks)
  • .gitignore (1 hunks)
  • .mise.toml (1 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • CLAUDE.md (1 hunks)
  • infrastructure/.python-version (1 hunks)
  • infrastructure/Pulumi.yaml (1 hunks)
  • infrastructure/__main__.py (1 hunks)
  • infrastructure/cloud_run.py (1 hunks)
  • infrastructure/main.py (1 hunks)
  • infrastructure/project.py (1 hunks)
  • infrastructure/pyproject.toml (1 hunks)
  • infrastructure/topics.py (1 hunks)
  • pyproject.toml (1 hunks)

Walkthrough

This update introduces a new documentation file for workflow guidelines, a local AI permissions configuration, and a YAML linting task. Several configuration and workflow files receive formatting improvements, such as adding YAML document start markers and adjusting indentation. The project’s linting process is extended to include YAML files, and minor cleanups are applied to environment and ignore files.

Changes

File(s) Change Summary
CLAUDE.md Added new documentation outlining assistant guidelines, workflows, code style, and GitHub issue procedures.
.claude/settings.local.json Introduced a permissions policy for command execution and web access for AI tools.
.mise.toml Added a new "lint" task for YAML linting, depending on Python linting.
.flox/env/manifest.toml Reordered package paths, removed [services] section, added yamllint, and cleaned up formatting.
.github/workflows/quality.yaml,
.github/workflows/test.yaml,
.github/workflows/stale.yaml,
.pre-commit-config.yaml
Added YAML document start markers and improved formatting/indentation for clarity and consistency.
.gitignore Added a newline at the end of the file.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Mise
    participant Yamllint

    Developer->>Mise: Run "mise lint"
    Mise->>Mise: Run "python:lint" (dependency)
    Mise->>Yamllint: Run "yamllint ."
    Yamllint-->>Mise: Return lint results
    Mise-->>Developer: Aggregate and display lint results
Loading

Poem

In the garden of code, a new guide appears,
With YAMLs now tidy, and linting cheers.
Permissions set wisely, commands in their place,
Workflows aligned with a neat, steady pace.
As rabbits, we hop—so nimble, so spry—
With each little change, our standards hop high!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
.claude/settings.local.json (1)

7-9: Consolidate overlapping mise run permissions.
You currently allow both "Bash(mise run test:*)" and "Bash(mise run:*)". Since mise run:* covers all run commands (including tests), consider removing the more specific permission or clearly documenting why both are needed.

CLAUDE.md (1)

29-29: Hyphenate "todo" for clarity.
Change todo to to-do when referring to tasks, e.g.:

-2. Issues with "todo" status are prepared for implementation
+2. Issues with "to-do" status are prepared for implementation

This addresses the hyphenation hint from LanguageTool.

🧰 Tools
🪛 LanguageTool

[grammar] ~29-~29: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...d and possibly modified 2. Issues with "todo" status are prepared for implementation...

(TO_DO_HYPHEN)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between bce8bdd and cc54f82.

⛔ Files ignored due to path filters (1)
  • .flox/env/manifest.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .claude/settings.local.json (1 hunks)
  • .flox/env/manifest.toml (1 hunks)
  • .github/workflows/quality.yaml (2 hunks)
  • .github/workflows/stale.yaml (2 hunks)
  • .github/workflows/test.yaml (1 hunks)
  • .gitignore (1 hunks)
  • .mise.toml (1 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • CLAUDE.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
CLAUDE.md

[grammar] ~29-~29: It appears that a hyphen is missing in the noun “to-do” (= task) or did you mean the verb “to do”?
Context: ...d and possibly modified 2. Issues with "todo" status are prepared for implementation...

(TO_DO_HYPHEN)

🪛 markdownlint-cli2 (0.17.2)
CLAUDE.md

14-14: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


15-15: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


17-17: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


18-18: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


19-19: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


20-20: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


21-21: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


22-22: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


23-23: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


24-24: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

🔇 Additional comments (12)
.gitignore (1)

7-7: Ensure Python bytecode caches are ignored
Good addition of __pycache__/ to prevent committing compiled Python files.

.github/workflows/test.yaml (1)

1-1: Add YAML document start marker
Introducing --- at the top aligns this workflow with the rest of the repository’s YAML files for consistency.

.github/workflows/quality.yaml (2)

1-1: Add YAML document start marker
Adding --- at the beginning standardizes the formatting across all GitHub Action workflows.


17-17: Remove trailing space from command
Cleaning up the trailing space in command: mise tasks run python:lint improves readability and avoids potential lint warnings.

.github/workflows/stale.yaml (3)

1-1: Add YAML document start marker
Consistent use of --- at the top of workflow files enhances formatting uniformity.


17-22: Reformat stale messages using folded block scalars
Switching to >- folded style makes multi-line messages more readable and maintainable without altering logic.


29-29: Exclude draft pull requests from stale workflow
Adding exempt-draft-pr: true prevents draft PRs from being marked stale, which is a desirable behavior.

.flox/env/manifest.toml (2)

6-6: Reorder uv.pkg-path entry
Moving uv.pkg-path within the [install] section is purely organizational and maintains logical grouping of package paths.


8-8: Add yamllint package path
Introducing yamllint.pkg-path = "yamllint" correctly supports the new YAML linting task defined in .mise.toml.

.pre-commit-config.yaml (2)

1-1: Add YAML document start marker for consistency.
The --- marker at the top ensures consistent YAML parsing across tools. This aligns with other YAML files in the repo.


5-10: Correct local hook indentation.
The hooks under the local repo are now properly indented (6–8 spaces) for each attribute, ensuring valid YAML structure for pre-commit.

.mise.toml (1)

69-74: Approve addition of global YAML lint task.
The new [tasks."lint"] target runs yamllint . and depends on python:lint, integrating YAML quality checks into the build pipeline.

Comment thread .claude/settings.local.json Outdated
Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
@chrisaddy chrisaddy changed the title Yaml lint Infrastructure and YAML Linting May 15, 2025
@chrisaddy chrisaddy force-pushed the yaml-lint branch 2 times, most recently from 5543b71 to 505ce9e Compare May 15, 2025 06:06
add yamllint and lint current yaml files

infrastructure for gcp cloud run
@chrisaddy chrisaddy changed the title Infrastructure and YAML Linting Infrastructure, Claude Code, and YAML Linting May 15, 2025
Copy link
Copy Markdown
Collaborator

@forstmeier forstmeier left a comment

Choose a reason for hiding this comment

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

Just a question on the cron job expression but approving regardless assuming that schedule is what we want.

name = "infrastructure"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not necessary in my experience but I won't hold up the PR on this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fix downstream


job = cloudscheduler.Job(
"datamanager-job",
schedule="0 * * * *",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want this running every minute?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

nah will fix

@chrisaddy chrisaddy merged commit bb65590 into master May 17, 2025
7 checks passed
@chrisaddy chrisaddy deleted the yaml-lint branch May 17, 2025 14:43
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