Skip to content

ci: avoid redundant application builds - #29

Merged
chrisae9 merged 2 commits into
devfrom
codex/build-pipeline-cleanup
Aug 8, 2026
Merged

ci: avoid redundant application builds#29
chrisae9 merged 2 commits into
devfrom
codex/build-pipeline-cleanup

Conversation

@chrisae9

@chrisae9 chrisae9 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • split build-free unit-test scripts from the local full build-and-test command
  • make CI, dev-image, and release verification build exactly once before tests
  • stop lint from compiling generated server output
  • mark the Vite config and ESM URL utility explicitly as modules to remove Node module-type warnings
  • normalize URL pathname and separator boundaries found during CodeRabbit review
  • keep the application and packaged server runtime CommonJS-compatible

Verification

  • clean SKIP_BUILD=true npm ci
  • lint from a clean generated-output state
  • npm run build && npm run test:ci (166 Node tests and 243 Vitest tests)
  • Mac mini npm test with exactly one Vite build and no module-type warnings
  • 12 focused URL utility tests, including malformed and boundary cases
  • package artifact install and launch smoke test
  • npm audit (0 vulnerabilities)
  • parsed all workflow YAML files
  • git diff --check

All CodeRabbit findings were addressed. Draft while final GitHub checks complete.

@chrisae9

chrisae9 commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The project adds Vite and Vitest configuration, introduces URL utilities, updates ESM import paths and ESLint resolution, and separates Node, frontend, unit, and CI test commands.

Changes

Build and test migration

Layer / File(s) Summary
Vite and ESM configuration
vite.config.mjs, eslint.config.mjs, server.js, test/config-public.test.js, test/socket-close.test.js
Adds Vite, Vue, Vuetify, build, version, configuration-generation, and Vitest settings. ESLint and imports now support the updated module paths.
URL utility functions
src/utils/combineurl.mjs, test/combineurl.test.js
Adds absolute URL resolution and slash-aware relative URL joining. The test imports the ESM utility.
Test command and CI wiring
package.json, .github/workflows/ci.yml, .github/workflows/dev-image.yml, .github/workflows/release.yml
Separates test scripts into Node, frontend, unit, and CI commands. CI workflows now run npm run test:ci.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: CI avoids redundant application builds by using build-free test commands after the required build.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/build-pipeline-cleanup

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/utils/combineurl.mjs`:
- Around line 10-13: Update combineRelativeUrlParts to normalize both inputs
before joining: remove trailing slash characters from a non-empty base and
leading slash characters from path, then concatenate them with exactly one
separator while preserving behavior for empty bases.
- Around line 1-8: Update combineUrl to parse base into a URL first, normalize
only its pathname by ensuring it ends with '/', and resolve url against that URL
object so existing query and fragment components remain intact. Add regression
tests covering bases with queries or fragments and relative URLs.

In `@test/combineurl.test.js`:
- Around line 4-12: Expand the combineurl tests in the existing describe/before
setup to cover a non-empty base with a leading-slash path, a combineUrl base
containing a query or fragment, and malformed base input. Assert the exact
returned URL/path values for valid boundary cases and the expected thrown errors
for malformed input, using the imported combineUrl and combineRelativeUrlParts
functions.
🪄 Autofix

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 24393f8c-6bbd-4252-815f-876e04ed3256

📥 Commits

Reviewing files that changed from the base of the PR and between ffd64fc and fd88c57.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • .github/workflows/dev-image.yml
  • .github/workflows/release.yml
  • eslint.config.mjs
  • package.json
  • server.js
  • src/utils/combineurl.mjs
  • test/combineurl.test.js
  • test/config-public.test.js
  • test/socket-close.test.js
  • vite.config.mjs

Comment thread test/combineurl.test.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/utils/combineurl.mjs`:
- Around line 10-13: Update combineRelativeUrlParts to normalize both inputs
before joining: remove trailing slash characters from a non-empty base and
leading slash characters from path, then concatenate them with exactly one
separator while preserving behavior for empty bases.
- Around line 1-8: Update combineUrl to parse base into a URL first, normalize
only its pathname by ensuring it ends with '/', and resolve url against that URL
object so existing query and fragment components remain intact. Add regression
tests covering bases with queries or fragments and relative URLs.

In `@test/combineurl.test.js`:
- Around line 4-12: Expand the combineurl tests in the existing describe/before
setup to cover a non-empty base with a leading-slash path, a combineUrl base
containing a query or fragment, and malformed base input. Assert the exact
returned URL/path values for valid boundary cases and the expected thrown errors
for malformed input, using the imported combineUrl and combineRelativeUrlParts
functions.
🪄 Autofix

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 24393f8c-6bbd-4252-815f-876e04ed3256

📥 Commits

Reviewing files that changed from the base of the PR and between ffd64fc and fd88c57.

📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • .github/workflows/dev-image.yml
  • .github/workflows/release.yml
  • eslint.config.mjs
  • package.json
  • server.js
  • src/utils/combineurl.mjs
  • test/combineurl.test.js
  • test/config-public.test.js
  • test/socket-close.test.js
  • vite.config.mjs
🛑 Comments failed to post (2)
src/utils/combineurl.mjs (2)

1-8: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
cat -n src/utils/combineurl.mjs
printf '%s\n' '--- usages and tests ---'
rg -n --glob '!node_modules' 'combineUrl|combineurl' .
printf '%s\n' '--- package metadata ---'
fd -HI 'package.json|.*test.*|.*spec.*' . | head -80

Repository: chrisae9/synclounge

Length of output: 5408


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- combineurl tests ---'
cat -n test/combineurl.test.js
printf '%s\n' '--- call-site context ---'
sed -n '55,100p' src/store/modules/synclounge/actions.js
printf '%s\n' '--- native URL behavior ---'
node - <<'JS'
const cases = [
  ['child', 'https://example.com/api?tenant=1'],
  ['child', 'https://example.com/api#section'],
  ['`#new`', 'https://example.com/api?tenant=1'],
  ['`#new`', 'https://example.com/api#section'],
  ['/child', 'https://example.com/api?tenant=1'],
];
for (const [url, base] of cases) {
  const currentBase = base.endsWith('/') ? base : `${base}/`;
  const current = new URL(url, currentBase).href;
  const fixedBase = new URL(base);
  if (!fixedBase.pathname.endsWith('/')) fixedBase.pathname += '/';
  const proposed = new URL(url, fixedBase).href;
  console.log(JSON.stringify({url, base, current, proposed}));
}
JS

Repository: chrisae9/synclounge

Length of output: 5231


Normalize URL.pathname, not the serialized base string.

When base contains a query or fragment, Line 5 appends / to that component. A relative url can then resolve against the wrong pathname or modify the query. Parse base first, append / to pathname, and add regression tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/utils/combineurl.mjs` around lines 1 - 8, Update combineUrl to parse base
into a URL first, normalize only its pathname by ensuring it ends with '/', and
resolve url against that URL object so existing query and fragment components
remain intact. Add regression tests covering bases with queries or fragments and
relative URLs.

10-13: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Normalize leading slashes in path.

Checking only the end of base does not guarantee one separator. A non-empty base plus a path beginning with / produces //. The same occurs when both inputs contain a slash. This can change the HTTP request path. Remove trailing slashes from base and leading slashes from path.

Proposed fix
 export const combineRelativeUrlParts = (base, path) => (!base
-  || base.charAt(base.length - 1) === '/'
-  ? `${base}${path}`
-  : `${base}/${path}`);
+  ? `${base}${path}`
+  : `${base.replace(/\/+$/, '')}/${path.replace(/^\/+/, '')}`);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

export const combineRelativeUrlParts = (base, path) => (!base
  ? `${base}${path}`
  : `${base.replace(/\/+$/, '')}/${path.replace(/^\/+/, '')}`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/utils/combineurl.mjs` around lines 10 - 13, Update
combineRelativeUrlParts to normalize both inputs before joining: remove trailing
slash characters from a non-empty base and leading slash characters from path,
then concatenate them with exactly one separator while preserving behavior for
empty bases.

@chrisae9
chrisae9 force-pushed the codex/build-pipeline-cleanup branch from fd88c57 to d8cf9d6 Compare August 8, 2026 06:59
@chrisae9

chrisae9 commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

Addressed all three CodeRabbit findings in 60d5631, including the two comments CodeRabbit could not post inline: combineUrl now normalizes the parsed URL pathname, combineRelativeUrlParts guarantees one separator for non-empty bases, and regression coverage includes query/fragment bases, duplicate separators, and malformed input. Validation: 12 focused URL tests, 166 Node tests, 243 Vitest tests, lint, build, and audit.

@chrisae9
chrisae9 marked this pull request as ready for review August 8, 2026 07:04
@chrisae9
chrisae9 merged commit 86d2d7b into dev Aug 8, 2026
11 checks passed
@chrisae9
chrisae9 deleted the codex/build-pipeline-cleanup branch August 8, 2026 07:04
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