Skip to content

feat : add build github ci#1

Merged
teamssUTXO merged 4 commits intomainfrom
add-build-ci
May 3, 2026
Merged

feat : add build github ci#1
teamssUTXO merged 4 commits intomainfrom
add-build-ci

Conversation

@teamssUTXO
Copy link
Copy Markdown
Contributor

@teamssUTXO teamssUTXO commented May 3, 2026

Summary by CodeRabbit

  • Chores
    • CI updated to run frontend and backend builds only when relevant, reducing unnecessary work.
    • Build environments standardized to improve consistency and reliability.
    • Deployment pipeline refined so container images are rebuilt after successful component builds.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow that detects changes under apps/frontend/** and apps/backend/** and conditionally runs frontend (pnpm), backend (Maven/Java 17), and a docker image build gated on prior build outcomes.

Changes

Conditional Monorepo Build Pipeline

Layer / File(s) Summary
Path Detection
.github/workflows/build-services.yml
New workflow triggers on push/pull_request to main and adds a changes job using dorny/paths-filter to expose frontend and backend boolean outputs.
Frontend Build
.github/workflows/build-services.yml
Adds frontend job conditional on needs.changes.outputs.frontend == 'true'; checks out code, sets up Node 20 and pnpm 9.15.0 with pnpm cache, runs pnpm install --frozen-lockfile and pnpm build in apps/frontend.
Backend Build
.github/workflows/build-services.yml
Adds backend job conditional on needs.changes.outputs.backend == 'true'; checks out code, sets up Temurin Java 17 with Maven cache, makes ./mvnw executable, and runs ./mvnw package -DskipTests -B in apps/backend.
Docker Build
.github/workflows/build-services.yml
Adds docker job depending on both build jobs; runs only if not cancelled/failed and at least one prior succeeded; copies .env.example to .env and runs docker compose build.

Sequence Diagram(s)

sequenceDiagram
  participant GH as GitHub Actions
  participant PF as Paths Filter (dorny/paths-filter)
  participant FE as Frontend Job (pnpm)
  participant BE as Backend Job (Maven)
  participant DC as Docker Job

  GH->>PF: on push/pr to main -> run changes job
  PF-->>GH: outputs frontend=true/false, backend=true/false
  alt frontend=true
    GH->>FE: trigger frontend job
    FE-->>GH: build success/failure
  end
  alt backend=true
    GH->>BE: trigger backend job
    BE-->>GH: build success/failure
  end
  GH->>DC: if jobs not cancelled/failed and >=1 success -> run docker job
  DC-->>GH: docker compose build
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibbled paths in the CI glen,
Telling frontend and backend when.
Builds hop in order, neat and spry,
Docker hums as clouds float by. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat : add build github ci' directly describes the main change: introducing a GitHub Actions CI workflow for building services.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-build-ci

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-services.yml:
- Around line 3-8: Add an explicit least-privilege permissions block to the
GitHub Actions workflow by defining a top-level permissions field (e.g.,
permissions: contents: read, id-token: write if needed) so the GITHUB_TOKEN only
has read-only access by default; update the workflow that defines the "on:"
triggers (push/pull_request) to include this permissions block and adjust any
job-specific permissions only where broader rights are strictly required.
- Around line 17-61: Replace mutable action tags with pinned commit SHAs: update
each uses entry shown (actions/checkout@v4, pnpm/action-setup@v4,
actions/setup-node@v4, actions/setup-java@v4) to reference the corresponding
full-length commit SHA for the action repository; for each uses line in the
workflow, look up the action's repository (e.g., actions/checkout,
pnpm/action-setup, actions/setup-node, actions/setup-java) and replace the `@v4`
tag with the full commit SHA string, ensuring all occurrences in the file are
updated and tested by re-running the workflow.
- Around line 19-22: The workflow step using pnpm/action-setup@v4 currently sets
version: latest which makes CI non-reproducible; update this by pinning an
explicit pnpm version (replace version: latest with a specific semver, e.g.,
"version: 7.18.1") or alternatively add a packageManager field to package.json
(e.g., packageManager: "pnpm@<version>") so pnpm is fixed; locate the
pnpm/action-setup step in the workflow and make one of these changes to ensure
consistent CI builds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a0a99cc-68a3-4fab-b829-149bd2ec8d59

📥 Commits

Reviewing files that changed from the base of the PR and between 45b9cd5 and d7e37ac.

📒 Files selected for processing (1)
  • .github/workflows/build-services.yml

Comment thread .github/workflows/build-services.yml
Comment thread .github/workflows/build-services.yml
Comment thread .github/workflows/build-services.yml
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-services.yml:
- Around line 80-95: The docker build job ("docker") currently runs when both
frontend and backend are skipped because the if condition only excludes
failure/cancelled; update the if expression to also require that at least one
upstream job succeeded (i.e., ensure a real service change). Replace the
existing if block with a compound expression that keeps the existing checks and
adds (contains(needs.frontend.result, 'success') ||
contains(needs.backend.result, 'success')) so the docker job only runs when
either frontend or backend actually ran and succeeded.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e110ee6a-52ec-436a-9e30-51dd0d54b1fb

📥 Commits

Reviewing files that changed from the base of the PR and between 21ad2e4 and b7a7908.

📒 Files selected for processing (1)
  • .github/workflows/build-services.yml

Comment thread .github/workflows/build-services.yml
Copy link
Copy Markdown

@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.

♻️ Duplicate comments (1)
.github/workflows/build-services.yml (1)

20-21: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pin uses: actions to full commit SHAs (mutable tags still in use).

@v4/@v3 refs are mutable and weaken CI supply-chain guarantees. This was raised earlier and is still present on Line 20, Line 21, Line 39, Line 41, Line 45, Line 66, Line 68, and Line 90.

Suggested patch pattern
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@<full_40_char_commit_sha>
-      - uses: dorny/paths-filter@v3
+      - uses: dorny/paths-filter@<full_40_char_commit_sha>
...
-      - uses: pnpm/action-setup@v4
+      - uses: pnpm/action-setup@<full_40_char_commit_sha>
-      - uses: actions/setup-node@v4
+      - uses: actions/setup-node@<full_40_char_commit_sha>
...
-      - uses: actions/setup-java@v4
+      - uses: actions/setup-java@<full_40_char_commit_sha>
#!/bin/bash
set -euo pipefail

file=".github/workflows/build-services.yml"

echo "All uses entries:"
rg -n '^\s*-\s+uses:\s+' "$file"

echo
echo "Non-SHA-pinned uses entries (should be empty):"
python - <<'PY'
import re
p = re.compile(r'^\s*-\s+uses:\s+([^@\s]+)@([^\s]+)\s*$')
sha = re.compile(r'^[0-9a-f]{40}$')
bad = []
with open(".github/workflows/build-services.yml", "r", encoding="utf-8") as f:
    for i, line in enumerate(f, 1):
        m = p.match(line.rstrip("\n"))
        if m and not sha.match(m.group(2)):
            bad.append((i, m.group(1), m.group(2)))
if not bad:
    print("OK: all actions are SHA pinned")
else:
    for i, repo, ref in bad:
        print(f"Line {i}: {repo}@{ref}")
PY

Also applies to: 39-42, 45-45, 66-68, 90-90

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build-services.yml around lines 20 - 21, Replace mutable
action tags with immutable commit SHAs: locate each "uses:" entry for
actions/checkout@v4, dorny/paths-filter@v3 and the other workflow actions
referenced (the entries flagged around the same block) and update their ref (the
'@...' suffix) to the full 40-character commit SHA for that action's repo. Edit
the .github workflow file to swap the tag/major ref to the corresponding SHA,
verify the SHA is correct by checking the action repo's tags/commits, and commit
the change so all "uses:" lines are pinned to exact SHAs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/build-services.yml:
- Around line 20-21: Replace mutable action tags with immutable commit SHAs:
locate each "uses:" entry for actions/checkout@v4, dorny/paths-filter@v3 and the
other workflow actions referenced (the entries flagged around the same block)
and update their ref (the '@...' suffix) to the full 40-character commit SHA for
that action's repo. Edit the .github workflow file to swap the tag/major ref to
the corresponding SHA, verify the SHA is correct by checking the action repo's
tags/commits, and commit the change so all "uses:" lines are pinned to exact
SHAs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c20a9e99-23c2-4d5d-8ff7-41fddc9b8e95

📥 Commits

Reviewing files that changed from the base of the PR and between b7a7908 and 67834ec.

📒 Files selected for processing (1)
  • .github/workflows/build-services.yml

@teamssUTXO teamssUTXO merged commit bf6c717 into main May 3, 2026
5 checks passed
@teamssUTXO teamssUTXO deleted the add-build-ci branch May 3, 2026 20:29
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