Skip to content

chore: refactors workflows to extract app-security separatelly#1576

Merged
stalniy merged 1 commit intomainfrom
chore/github-workflows2
Jun 27, 2025
Merged

chore: refactors workflows to extract app-security separatelly#1576
stalniy merged 1 commit intomainfrom
chore/github-workflows2

Conversation

@stalniy
Copy link
Contributor

@stalniy stalniy commented Jun 27, 2025

Why

This is required in order to get access to secrets. There are just 2 ways to get them for outside collaborators:

  • use on pull_request_target
  • use on workflow_run

I decided to keep our CIs as is because it's much safer to run in secrets-less environment. And then check code for security issues only after workflow finished. Collaborators repository is then cloned in a separate folder but workflows are checked out from our main branch and then it runs snyk for outside collaborator code.

What

refactors workflows to extract app-security separatelly. Github doesn't pass enough context from previous workflow, that's why some it I encoded in workflow name.

Also deleted action for GCP deployment

Reference: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/

Summary by CodeRabbit

  • Chores
    • Consolidated validation steps across multiple workflows into a reusable workflow for improved consistency and maintainability.
    • Added event-based input parameters to validation jobs for better workflow control.
    • Removed dedicated security scanning jobs from all workflows.
    • Simplified build and test job steps, reducing redundancy and streamlining CI processes.
    • Deleted a custom GitHub Action for updating GCP VM container images.

@stalniy stalniy requested a review from a team as a code owner June 27, 2025 10:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

Walkthrough

This update refactors multiple GitHub Actions workflows to use a new reusable validation workflow, standardizes event context handling via explicit inputs, and removes inline security scanning jobs. It also deletes a custom GCP deployment action and introduces a new reusable validation workflow for monorepo applications.

Changes

File(s) Change Summary
.github/actions/gcp-deploy/action.yml Deleted composite GitHub Action for updating GCP VM container images.
.github/workflows/console-api-validate-n-build.yml
.github/workflows/console-web-docker-build.yml
.github/workflows/indexer-docker-build.yml
.github/workflows/notifications-validate-n-build.yml
.github/workflows/provider-console-docker-build.yml
.github/workflows/provider-proxy-docker-build.yml
.github/workflows/stats-web-docker-build.yml
Refactored validation jobs to use a new reusable workflow, standardized event input via workflow-trigger, removed security jobs, and simplified test/build steps.
.github/workflows/local-packages-validate.yml Renamed workflow and removed local security check step.
.github/workflows/reusable-should-validate.yml Added required workflow-trigger input, updated output logic to use the input instead of GitHub context.
.github/workflows/reusable-validate-app.yml Added new reusable workflow for app validation, handling checkout, lint, test, and coverage upload.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as Caller Workflow
    participant ShouldValidate as Reusable Should-Validate
    participant ValidateApp as Reusable Validate-App

    Workflow->>ShouldValidate: Call with app, workflow-trigger
    ShouldValidate-->>Workflow: Output enabled/has_changes

    alt Validation enabled
        Workflow->>ValidateApp: Call with app, test-command, secrets
        ValidateApp->>ValidateApp: Checkout, setup deps, lint, test, upload coverage
    end
Loading

Suggested reviewers

  • baktun14

Poem

In the warren of code, we tidy and prune,
Old actions hop out, new workflows bloom soon.
Security scans take a rest in the sun,
Reusable steps now get the job done.
With carrots of coverage and linting delight,
This rabbit approves—your CI is light! 🥕


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.

@stalniy stalniy force-pushed the chore/github-workflows2 branch 4 times, most recently from 5991b2c to a140bc4 Compare June 27, 2025 11:00
@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.98%. Comparing base (dac08eb) to head (6fc1cbc).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1576      +/-   ##
==========================================
+ Coverage   40.76%   40.98%   +0.22%     
==========================================
  Files         873      874       +1     
  Lines       21263    21282      +19     
  Branches     3887     3868      -19     
==========================================
+ Hits         8668     8723      +55     
+ Misses      12412    11842     -570     
- Partials      183      717     +534     
Flag Coverage Δ
api 72.00% <ø> (+0.63%) ⬆️
deploy-web 19.20% <ø> (ø)
notifications 87.90% <ø> (ø)
provider-proxy 82.13% <ø> (ø)

see 189 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stalniy stalniy force-pushed the chore/github-workflows2 branch from a140bc4 to 6fc1cbc Compare June 27, 2025 17:57
Copy link
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: 2

♻️ Duplicate comments (4)
.github/workflows/console-api-validate-n-build.yml (1)

18-18: Same input-name concern as in Indexer workflow.
Ensure reusable-should-validate.yml exposes workflow-trigger.

.github/workflows/provider-proxy-docker-build.yml (2)

19-19: Input name verification.
Same observation as above — confirm the reusable workflow expects workflow-trigger.


24-27: Secret forwarding risk repeats here.
Limit the inherited secrets or harden the called workflow.

.github/workflows/notifications-validate-n-build.yml (1)

19-19: Verify workflow-trigger input existence.

🧹 Nitpick comments (4)
.github/workflows/indexer-docker-build.yml (1)

32-32: Nit: add a descriptive step name for easier GitHub UI scanning.

-      - run: packages/docker/script/dc.sh build indexer
+      - name: Build Docker image for Indexer
+        run: packages/docker/script/dc.sh build indexer
.github/workflows/provider-proxy-docker-build.yml (1)

36-36: Provide a step name for clarity.

-      - run: packages/docker/script/dc.sh build provider-proxy
+      - name: Build Docker image for Provider-Proxy
+        run: packages/docker/script/dc.sh build provider-proxy
.github/workflows/notifications-validate-n-build.yml (2)

24-33: Secrets propagation & long inline test script.

Same concerns as raised for the API workflow:
• Review secrets: inherit exposure.
• Consider moving the multiline test-command into scripts/test_notifications.sh for maintainability.


34-40: Add explicit step name for the Docker build.

-      - uses: actions/checkout@v4
-      - run: packages/docker/script/dc.sh build notifications
+      - uses: actions/checkout@v4
+      - name: Build Docker image for Notifications
+        run: packages/docker/script/dc.sh build notifications
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7427d1f and 6fc1cbc.

📒 Files selected for processing (11)
  • .github/actions/gcp-deploy/action.yml (0 hunks)
  • .github/workflows/console-api-validate-n-build.yml (1 hunks)
  • .github/workflows/console-web-docker-build.yml (2 hunks)
  • .github/workflows/indexer-docker-build.yml (2 hunks)
  • .github/workflows/local-packages-validate.yml (1 hunks)
  • .github/workflows/notifications-validate-n-build.yml (1 hunks)
  • .github/workflows/provider-console-docker-build.yml (2 hunks)
  • .github/workflows/provider-proxy-docker-build.yml (2 hunks)
  • .github/workflows/reusable-should-validate.yml (2 hunks)
  • .github/workflows/reusable-validate-app.yml (1 hunks)
  • .github/workflows/stats-web-docker-build.yml (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/actions/gcp-deploy/action.yml
🚧 Files skipped from review as they are similar to previous changes (6)
  • .github/workflows/local-packages-validate.yml
  • .github/workflows/provider-console-docker-build.yml
  • .github/workflows/console-web-docker-build.yml
  • .github/workflows/reusable-should-validate.yml
  • .github/workflows/stats-web-docker-build.yml
  • .github/workflows/reusable-validate-app.yml
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: test-stats-web-build
  • GitHub Check: test-indexer-build
  • GitHub Check: validate-notifications / validate-app
  • GitHub Check: test-notifications-build
  • GitHub Check: test-provider-console-build
  • GitHub Check: validate-api / validate-app
  • GitHub Check: test-api-build
  • GitHub Check: validate-deploy-web / validate-app
  • GitHub Check: test-deploy-web-build
  • GitHub Check: test-provider-proxy-build
  • GitHub Check: Validate local packages
🔇 Additional comments (1)
.github/workflows/indexer-docker-build.yml (1)

15-15: Pass-through of workflow-trigger looks correct — just verify the input name in the reusable workflow.

reusable-should-validate.yml must expose an input called workflow-trigger. If that input was renamed during the refactor, this line will silently fall back to the default and the decision logic could mis-behave.

@stalniy stalniy merged commit 4f7fcac into main Jun 27, 2025
36 checks passed
@stalniy stalniy deleted the chore/github-workflows2 branch June 27, 2025 18:34
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.

1 participant

Comments