Skip to content

Conversation

@iAmAshuSahoo
Copy link
Contributor

@iAmAshuSahoo iAmAshuSahoo commented May 10, 2025

Date: 11 May 2025

Developer Name: Ashutosh Sahoo


Issue Ticket Number

Description

CI runs all jobs even if early checks like ESLint or Prettier fail. This means tests and deployments still run, even when the code isn't clean or build-ready.

As a part of this task, we want to upgrade the dependencies on the workflow. We want to skip the jobs if any of the tasks fail. We want to optimize the overall experience.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1. When Build fails

image

  1. When test fails
    image

  2. When all the jobs pass
    image

Test Coverage

Screenshot 1 Not required

Additional Notes

  1. Tried to work with worflow_run to keep jobs in different workflows. But, this is not working as expected.
  2. Created ticket for above 997.
  3. Test PRs to test actions. 6 5

@coderabbitai
Copy link

coderabbitai bot commented May 10, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • Chores
    • Replaced multiple GitHub Actions workflows with a single consolidated workflow for building, testing, and code analysis.
    • Adjusted CodeQL analysis workflow to run only on a weekly schedule.
  • Style
    • Corrected indentation of a button link in the main HTML file.

Walkthrough

This update restructures GitHub Actions workflows by deleting separate CI and test workflow files, removing most triggers from the CodeQL workflow, and introducing a consolidated workflow that handles build, test, and CodeQL analysis jobs. Additionally, a minor indentation correction is made to an anchor tag in the HTML file.

Changes

File(s) Change Summary
.github/workflows/CI.yml,
.github/workflows/tests.yml
Deleted separate CI and test workflow files.
.github/workflows/codeql-analysis.yml Removed push and pull request triggers, retaining only a scheduled weekly run for CodeQL analysis.
.github/workflows/workflow.yml Added a new unified workflow with build, test, and analyze (CodeQL) jobs, combining previous workflows.
index.html Corrected indentation of the <a id="application-button"> anchor tag within the button section.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub
    participant Workflow (workflow.yml)
    participant Build Job
    participant Test Job
    participant Analyze Job (CodeQL)

    GitHub->>Workflow (workflow.yml): Pull request opened
    Workflow (workflow.yml)->>Build Job: Start build (Node.js setup, npm install, npm check)
    Build Job-->>Test Job: On success, start test (Yarn install, Yarn test)
    Build Job-->>Analyze Job: On success, allow analyze to start (waits for Test Job too)
    Test Job-->>Analyze Job: On success, allow analyze to start
    Analyze Job->>Analyze Job: Run CodeQL analysis
Loading

Possibly related issues

Poem

In the warren of code, where actions once sprawled,
Now a single workflow, neat and enthralled.
Build, test, and analyze—each job in its place,
With triggers and steps all set for the race.
Even HTML tags now line up just right—
The dashboard hops forward, swift as a byte!
🐇✨


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

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6c68aa9 and bc9c171.

📒 Files selected for processing (5)
  • .github/workflows/CI.yml (0 hunks)
  • .github/workflows/codeql-analysis.yml (0 hunks)
  • .github/workflows/tests.yml (0 hunks)
  • .github/workflows/workflow.yml (1 hunks)
  • index.html (1 hunks)
💤 Files with no reviewable changes (3)
  • .github/workflows/CI.yml
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/tests.yml
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/workflow.yml

17-17: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


19-19: the runner of "actions/setup-node@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


28-28: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


56-56: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


60-60: the runner of "github/codeql-action/init@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


73-73: the runner of "github/codeql-action/autobuild@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


86-86: the runner of "github/codeql-action/analyze@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.35.1)
.github/workflows/workflow.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 28-28: wrong indentation: expected 6 but found 4

(indentation)


[error] 87-87: trailing spaces

(trailing-spaces)

🔇 Additional comments (4)
index.html (1)

146-148: Fix indentation of the Application button markup.

The <a> element for the "Applications" button is now correctly nested and aligned with its sibling elements, improving readability without affecting functionality.

.github/workflows/workflow.yml (3)

1-7: Trigger configuration looks sound.

The workflow is set to run on all pull requests across any branch (branches: ['**']), ensuring early detection of failures on every PR.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


38-46: Dependency configuration ensures conditional execution.

The needs: [build, test] setting correctly prevents the analyze job from running if either build or test fails, aligning with the PR objective to skip downstream jobs on early failure.


55-61: CodeQL initialization is correctly configured.

The checkout action is up-to-date (v3), and CodeQL is initialized for the specified matrix.language. No issues detected here.

🧰 Tools
🪛 actionlint (1.7.4)

56-56: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


60-60: the runner of "github/codeql-action/init@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Contributor

@Suvidh-kaushik Suvidh-kaushik left a comment

Choose a reason for hiding this comment

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

please get the neutral check confirmed with Prakash sir everything else
LGTM.!

@iAmAshuSahoo
Copy link
Contributor Author

iAmAshuSahoo commented May 25, 2025

  • name: Install system dependencies
    run: |
    echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns

Above disables a security restriction enforced by Ubuntu's AppArmor on unprivileged user namespaces.

What does this mean?
AppArmor is a Linux security module that confines programs to a limited set of resources.

Starting with Ubuntu 23.10, AppArmor restricts the use of unprivileged user namespaces by default for security reasons.

Unprivileged user namespaces allow processes without administrative rights to create isolated environments (used by sandboxing, containers, etc.).

The kernel parameter kernel.apparmor_restrict_unprivileged_userns controls whether AppArmor enforces these restrictions.

When set to 1 (default), AppArmor restricts unprivileged user namespaces.

When set to 0, it disables this restriction, allowing unprivileged user namespaces to be used freely.

Why is this step used in CI workflows?
Ubuntu 23.10 and later versions introduced this AppArmor restriction by default to harden security, but it breaks some legitimate workloads that require unprivileged user namespaces.

@iAmAshuSahoo
Copy link
Contributor Author

iAmAshuSahoo commented May 25, 2025

@prakashchoudhary07 When we are removing the disabled security, all our tests are failing. Referring to the above explanations as stated above, the possible reason this failed is, it is checking for an authorised user.

Thus, we are disabling AppArmor. As I am re-using the existing code, I may dedicate separate time to understand if we can achieve this without disabling Ubuntu's Apparmor. If required, I will add this to the new ticket for further investigation.

https://github.com/Real-Dev-Squad/website-dashboard/actions/runs/15241161065/job/42861400927

Commented the dependency. Ran the code again to re-verify.
https://github.com/Real-Dev-Squad/website-dashboard/actions/runs/15248579534/job/42879818510

@prakashchoudhary07 prakashchoudhary07 merged commit bb92963 into RealDevSquad:develop May 26, 2025
5 of 6 checks passed
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.

Prevent CI from continuing after early job failures

6 participants