Skip to content

Comments

chore(yamllint): Allow longer lines to avoid unneeded linter disabling#811

Merged
MaxymVlasov merged 1 commit intomasterfrom
yamlint_style_lenght
Feb 10, 2025
Merged

chore(yamllint): Allow longer lines to avoid unneeded linter disabling#811
MaxymVlasov merged 1 commit intomasterfrom
yamlint_style_lenght

Conversation

@MaxymVlasov
Copy link
Collaborator

@MaxymVlasov MaxymVlasov commented Feb 10, 2025

Formatter which will be introduced later, will enforce stricter rules when it is possible

Summary by CodeRabbit

  • Tests
    • Introduced a new SSH command test that verifies version output.
  • Chores
    • Optimized build, release, and CI workflows with updated actions and enhanced caching mechanisms.
  • Style
    • Removed redundant linting comments and introduced a new YAML line-length rule to ensure configuration consistency.

Formater which will be introduced later, will enforse stricter rules
when it possible
@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2025

Walkthrough

This pull request updates multiple GitHub Actions workflows, container tests, and YAML lint configurations. It adds a new SSH command test, removes various inline yamllint disable comments, and updates several action versions. The CI/CD pipeline has been streamlined by eliminating redundant Python setup and checkout steps and introducing hash calculations for improved caching. Additionally, conditional executions have been added for Docker image builds and release processes, while permissions have been adjusted in select workflows. A new line-length rule has also been introduced in the .yamllint configuration.

Changes

File(s) Change Summary
.github/.container-structure-test-config.yaml Added new SSH command test (using ssh -V with error pattern matching) and removed a yamllint disable comment from the terrascan test section.
.github/workflows/build-image-test.yaml
.github/workflows/build-image.yaml
Removed yamllint disable comments; in build-image.yaml, added conditional steps (OS check for Multi-arch build and event-type based Docker tag selection).
.github/workflows/ci-cd.yml Removed Python setup and checkout steps; added steps to calculate hash values for generating cache keys; updated job dependencies and output variables.
.github/workflows/codeql.yml
.github/workflows/scorecards.yml
Removed yamllint disable comments from multiple steps without affecting the workflow logic.
.github/workflows/dependency-review.yml Updated action versions for actions/checkout (to v4.2.2) and actions/dependency-review-action (to v4.5.0).
.github/workflows/pr-title.yml Added a permissions section (granting read for pull-requests and write for statuses) and removed a yamllint comment.
.github/workflows/pre-commit.yaml Added a new fetch command to retrieve all branches from the origin repository.
.github/workflows/release.yml Updated job permissions (contents, issues, pull-requests set to write) and bumped the version of the semantic release action.
.github/workflows/reusable-tox.yml Removed the sdist source retrieval step; updated versions for actions (setup-python, checkout, cache, Codecov actions) and added a condition to send coverage data only when available.
.yamllint Introduced a new rule limiting line length to 100 characters.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI/CD Workflow
    participant PreSetup as Pre-Setup Job
    participant Build as Build Job
    participant Lint as Lint Job
    participant Tests as Tests Job
    participant Cache as Cache System

    CI->>PreSetup: Trigger pre-setup job
    PreSetup->>PreSetup: Calculate hash values (Python & dependencies)
    PreSetup->>Cache: Generate cache key
    Cache-->>PreSetup: Return cache key
    PreSetup->>Lint: Provide cache key outputs
    PreSetup->>Tests: Provide cache key outputs
    CI->>Build: Continue build (without explicit Python setup/checkout)
Loading
sequenceDiagram
    participant GH as GitHub Actions
    participant Release as Release Job
    participant Semantic as Semantic Release Action

    GH->>Release: Trigger release event
    Release->>Semantic: Run semantic-release with updated permissions
    Semantic-->>Release: Create release and comment on issues/pull-requests
Loading

Suggested Reviewers

  • yermulnik

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b50354 and f8875b3.

📒 Files selected for processing (12)
  • .github/.container-structure-test-config.yaml (0 hunks)
  • .github/workflows/build-image-test.yaml (0 hunks)
  • .github/workflows/build-image.yaml (0 hunks)
  • .github/workflows/ci-cd.yml (0 hunks)
  • .github/workflows/codeql.yml (0 hunks)
  • .github/workflows/dependency-review.yml (0 hunks)
  • .github/workflows/pr-title.yml (0 hunks)
  • .github/workflows/pre-commit.yaml (0 hunks)
  • .github/workflows/release.yml (0 hunks)
  • .github/workflows/reusable-tox.yml (0 hunks)
  • .github/workflows/scorecards.yml (0 hunks)
  • .yamllint (1 hunks)
💤 Files with no reviewable changes (11)
  • .github/workflows/codeql.yml
  • .github/workflows/pre-commit.yaml
  • .github/workflows/scorecards.yml
  • .github/workflows/build-image-test.yaml
  • .github/workflows/build-image.yaml
  • .github/.container-structure-test-config.yaml
  • .github/workflows/pr-title.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/ci-cd.yml
  • .github/workflows/release.yml
  • .github/workflows/reusable-tox.yml
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: 🧪 Tests / pytest@🐍3.9@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.13@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.12@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.11@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.10@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.10@macos-14
  • GitHub Check: 🧹 Linters / pre-commit@🐍3.13@ubuntu-latest
  • GitHub Check: 🧪 Tests / pytest@🐍3.9@macos-14
  • GitHub Check: 🧪 Tests / pytest@🐍3.9@macos-13
  • GitHub Check: 🧪 Tests / pytest@🐍3.13@windows-2025
  • GitHub Check: 🧪 Tests / pytest@🐍3.13@macos-14
  • GitHub Check: 🧪 Tests / pytest@🐍3.13@macos-13
  • GitHub Check: 🧪 Tests / pytest@🐍3.12@windows-2025
  • GitHub Check: Ubuntu ARM
  • GitHub Check: pre-commit

Comment on lines +11 to +12
line-length:
max: 100
Copy link

@coderabbitai coderabbitai bot Feb 10, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

LGTM! The line-length rule addition aligns with the PR objectives.

Setting max line length to 100 characters is a reasonable choice that:

  • Reduces the need for inline linter disabling
  • Maintains code readability
  • Aligns with common industry practices

Let's verify the impact of this change by checking for any remaining yamllint disable comments:


🏁 Script executed:

#!/bin/bash
# Description: Search for any remaining yamllint disable comments related to line length
# that might need to be removed after this change

rg -i "yamllint disable.*line-length" .github/

Length of output: 211


Inline Disables for Line-Length Remain in Workflow Files

The script output shows that inline yamllint disable comments for the line-length rule still exist in the following files:

  • .github/workflows/build-image-test.yaml
  • .github/workflows/codeql.yml

Since the .yamllint file now enforces a max line length of 100—which aligns with the PR’s objectives to reduce inline linter disabling—please consider removing these inline disable comments if they are no longer needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a great use case of AI 👍🏻
@MaxymVlasov FYI ⬆️

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, these 2 comments still exist because these lines > 100. So false-positive, but still nice

@MaxymVlasov MaxymVlasov merged commit 156a897 into master Feb 10, 2025
68 checks passed
@MaxymVlasov MaxymVlasov deleted the yamlint_style_lenght branch February 10, 2025 16:14
@antonbabenko
Copy link
Owner

This PR is included in version 1.97.4 🎉

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.

3 participants