Skip to content

🏗️ Composite#127

Merged
NatoBoram merged 6 commits into
mainfrom
feature/composite
Jun 18, 2026
Merged

🏗️ Composite#127
NatoBoram merged 6 commits into
mainfrom
feature/composite

Conversation

@NatoBoram

@NatoBoram NatoBoram commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Update dependencies and migrate to a TypeScript Composite project.

Summary by CodeRabbit

Release Notes

  • Documentation

    • Refined generated API (OpenAPI) type documentation, including reworked descriptions and examples.
  • Tests

    • Improved project lookup in tests to better handle varying/empty returned data.
  • New Features

    • Updated the release/publishing workflow to publish via a packaged artifact with enhanced security, and streamlined release creation.
  • Chores

    • Refreshed build/TypeScript/lint-test tooling and updated runtime/development dependencies.
    • Updated the Base64 utility to return a string consistently.

Signed-off-by: Nathan Gendron <nato@coderabbit.ai>
Signed-off-by: Nathan Gendron <nato@coderabbit.ai>
@NatoBoram
NatoBoram requested a review from a team as a code owner June 16, 2026 05:04
@NatoBoram
NatoBoram requested review from nehal-a2z and tejascoderabbit and removed request for a team June 16, 2026 05:04
@NatoBoram NatoBoram self-assigned this Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 83669d9c-3663-4060-b988-3bc9e635209e

📥 Commits

Reviewing files that changed from the base of the PR and between 3fd14a8 and 3e25a5b.

📒 Files selected for processing (1)
  • src/base64.ts

📝 Walkthrough

Walkthrough

The publish workflow is restructured from a single job into separate artifact-passing jobs for building, publishing to npm and GitHub Packages with OIDC provenance, and creating a GitHub release. TypeScript project references are introduced for src/cloud and src/server, the build script switches to tsgo --build, the fromBase64 return type narrows to string only, dependencies are bumped including openapi-fetch to ~0.17.0, and generated OpenAPI JSDoc comments are reformatted. Release and publishing instructions are documented in CONTRIBUTING.md.

Changes

CI/CD Publish Pipeline Restructuring

Layer / File(s) Summary
Build job hardening and artifact upload
.github/workflows/pnpm-publish.yaml
Adds explicit contents: read permissions, disables credential persistence on checkout, runs pnpm pack with gzip compression level 9, and conditionally uploads the tgz as a workflow artifact.
publish-npm and publish-github jobs
.github/workflows/pnpm-publish.yaml
Two new jobs download the artifact and publish to registry.npmjs.org and npm.pkg.github.com respectively with OIDC provenance, gated against nektos/act, and compute package version URLs as job outputs.
GitHub release creation job
.github/workflows/pnpm-publish.yaml
A separate release job downloads the tgz artifact and calls gh release create with --generate-notes using the workflow tag.
Release and publishing documentation
CONTRIBUTING.md
Documents the GitHub Actions-driven release workflow, version bumping process, release branch/commit/PR creation, CI gating, and final signed tag + push steps.

TypeScript Project References, Type Changes, and Tooling Upgrades

Layer / File(s) Summary
TypeScript project references and root configuration
tsconfig.json, src/cloud/tsconfig.json, src/server/tsconfig.json
Root tsconfig.json adds types: ["node"], excludes src/cloud and src/server, and references their new sub-tsconfigs. New src/cloud/tsconfig.json and src/server/tsconfig.json extend the root config.
Build script and CI workflow updates
package.json, .github/workflows/node.js.yaml
Build script changes from tsgo to tsgo --build to activate project-reference compilation. Node.js CI workflow removes --noEmit flag from build command.
Type contract narrowing and test fix
src/base64.ts, tests/server/projects.test.ts
fromBase64 return type narrows from Buffer | Uint8Array | string to string only. The projects test imports SchemaRestProject and normalises page.data?.values via Array.from before calling .find.
Dependency and workspace tooling updates
package.json, pnpm-workspace.yaml
openapi-fetch bumped to ~0.17.0; devDependencies (ESLint, TypeScript toolchain, prettier, typedoc, vitest) upgraded to newer versions. pnpm-workspace.yaml replaces ignoredBuiltDependencies with allowBuilds: {esbuild: false}.
Generated OpenAPI JSDoc reformatting
src/server/openapi/openapi-typescript.ts
Regenerated file reformats @description and @example JSDoc blocks across schemas and endpoint definitions—expanding compact single-line comments into multi-line bullet structures—with no changes to exported type shapes or runtime logic.

Sequence Diagram(s)

sequenceDiagram
  participant build as build job
  participant artifact as GitHub Artifact Store
  participant publish_npm as publish-npm job
  participant publish_github as publish-github job
  participant release as release job
  participant npmjs as registry.npmjs.org
  participant ghpkg as npm.pkg.github.com
  participant ghrelease as GitHub Releases

  build->>artifact: upload coderabbitai-bitbucket-*.tgz
  publish_npm->>artifact: download tgz
  publish_npm->>npmjs: pnpm publish --provenance (`@coderabbitai` scope)
  publish_github->>artifact: download tgz
  publish_github->>ghpkg: pnpm publish --provenance (`@coderabbitai` scope)
  publish_github->>ghpkg: gh api → package version URL
  release->>artifact: download tgz
  release->>ghrelease: gh release create --generate-notes
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

enhancement, dependencies, documentation, javascript

Poem

🐇 Hop, hop, the pipeline splits in three,
A tgz packed with gzip level nine so bright!
npm and GitHub Packages both receive their key,
The release job tags the branch with flair and might.
Old Buffer types fade to string alone,
New tsconfigs root the project's ground,
A rabbit tidied what the toolchain has sown! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and does not follow the repository's required template structure with sections like '📝 Description' and '📓 References'. Expand the description to match the template: add a '📝 Description' section explaining why the migration was necessary, why this approach was chosen, and what was done; include a '📓 References' section with relevant links.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '🏗️ Composite' is vague and generic, using only an emoji and a single word that lacks sufficient context about the changeset's primary objectives. Consider a more descriptive title such as 'Migrate to TypeScript Composite project and update dependencies' to clearly communicate the main changes.
✅ Passed checks (2 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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/composite

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

github-actions Bot and others added 3 commits June 16, 2026 05:05
Signed-off-by: Nathan Gendron <nato@coderabbit.ai>
Signed-off-by: Nathan Gendron <nato@coderabbit.ai>

@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

🧹 Nitpick comments (2)
.github/workflows/pnpm-publish.yaml (1)

16-18: ⚖️ Poor tradeoff

Consider pinning actions to SHA hashes for supply chain security.

Static analysis flags all action references as unpinned. Pinning to commit SHAs prevents tag-hijacking attacks where a malicious actor moves a version tag to a compromised commit. For example:

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

This is a security-versus-maintainability tradeoff. If your organization's policy requires pinned actions, consider using a tool like Dependabot or Renovate to automate SHA updates.

🤖 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 @.github/workflows/pnpm-publish.yaml around lines 16 - 18, The
actions/checkout action reference in the workflow file is pinned to a version
tag (v6) rather than a specific commit SHA, which creates a security
vulnerability to tag-hijacking attacks. Update the uses field for
actions/checkout to pin it to a specific commit SHA hash instead of the version
tag, and include the version number as a trailing comment for maintainability.
This ensures the workflow runs against a specific, immutable commit rather than
a mutable tag that could potentially be moved to a malicious commit.

Source: Linters/SAST tools

package.json (1)

34-35: Extend clean script to include referenced-project build artifacts.

With the composite TypeScript build configuration, the tsgo --build command creates .tsbuildinfo files for both the root project and referenced subprojects (src/cloud and src/server). The current clean script only removes the root tsconfig.tsbuildinfo, leaving stale incremental build artifacts that can cause inconsistent builds during development.

Suggested diff
-		"clean": "rm -rf dist docs node_modules tsconfig.tsbuildinfo",
+		"clean": "rm -rf dist docs node_modules tsconfig.tsbuildinfo src/cloud/tsconfig.tsbuildinfo src/server/tsconfig.tsbuildinfo",
🤖 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 `@package.json` around lines 34 - 35, The clean script in package.json
currently only removes the root tsconfig.tsbuildinfo file, but with the
composite TypeScript build configuration, .tsbuildinfo files are also created in
the referenced subproject directories (src/cloud and src/server). Extend the
clean script to additionally remove the .tsbuildinfo files from these
subdirectories so that all incremental build artifacts are properly cleaned and
stale builds don't interfere with development.
🤖 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 @.github/workflows/pnpm-publish.yaml:
- Line 63: The pnpm publish step at line 63 is missing the NODE_AUTH_TOKEN
environment variable that the setup-node action requires for npm authentication.
Add an env section to the run step that publishes the tarball file (the command
`pnpm publish coderabbitai-bitbucket-*.tgz --access public --no-git-checks
--provenance`) and set NODE_AUTH_TOKEN to reference the appropriate npm token
secret for your repository. Follow the same pattern used in the publish-github
job at line 98, replacing NPM_TOKEN with the actual secret name your repository
uses (such as CODERABBIT_NPM_TOKEN).

In `@src/base64.ts`:
- Around line 1-4: The fromBase64 function's return type annotation declares
Uint8Array | string but the implementation always returns a string via
TextDecoder().decode(bytes), so the Uint8Array type in the union is unreachable.
Narrow the return type annotation of the fromBase64 function to just string to
accurately reflect what the function actually returns.

In `@src/server/openapi/openapi-typescript.ts`:
- Around line 17176-17180: The generated JSDoc block descriptions have collapsed
whitespace between list items, making them unreadable. The post-processing step
in the OpenAPI TypeScript code generator needs to be fixed to preserve proper
line breaks and spacing within JSDoc description blocks. In
src/server/openapi/openapi-typescript.ts at lines 17176-17180 and the
consolidated sites at lines 23198-23204, 23297-23297, 23379-23382, 27579-27583,
and 37598-37602, the bullet points and list items have been merged together. Fix
the generator or post-processor that creates these JSDoc blocks to ensure it
properly formats multi-line descriptions by preserving newlines and indentation
between list items so that each bullet point or sentence remains on its own line
with appropriate spacing.

---

Nitpick comments:
In @.github/workflows/pnpm-publish.yaml:
- Around line 16-18: The actions/checkout action reference in the workflow file
is pinned to a version tag (v6) rather than a specific commit SHA, which creates
a security vulnerability to tag-hijacking attacks. Update the uses field for
actions/checkout to pin it to a specific commit SHA hash instead of the version
tag, and include the version number as a trailing comment for maintainability.
This ensures the workflow runs against a specific, immutable commit rather than
a mutable tag that could potentially be moved to a malicious commit.

In `@package.json`:
- Around line 34-35: The clean script in package.json currently only removes the
root tsconfig.tsbuildinfo file, but with the composite TypeScript build
configuration, .tsbuildinfo files are also created in the referenced subproject
directories (src/cloud and src/server). Extend the clean script to additionally
remove the .tsbuildinfo files from these subdirectories so that all incremental
build artifacts are properly cleaned and stale builds don't interfere with
development.
🪄 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: Central YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 98118017-a99a-4315-9b00-6ddad6ddd22a

📥 Commits

Reviewing files that changed from the base of the PR and between c6a6579 and 7414066.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • .github/workflows/pnpm-publish.yaml
  • package.json
  • pnpm-workspace.yaml
  • src/base64.ts
  • src/cloud/openapi/openapi-typescript.ts
  • src/cloud/openapi/swagger.v3.json
  • src/cloud/tsconfig.json
  • src/server/openapi/openapi-typescript.ts
  • src/server/tsconfig.json
  • src/types/undici-types.d.ts
  • tests/server/projects.test.ts
  • tsconfig.json
💤 Files with no reviewable changes (1)
  • src/types/undici-types.d.ts

Comment thread .github/workflows/pnpm-publish.yaml
Comment thread src/base64.ts Outdated
Comment thread src/server/openapi/openapi-typescript.ts
Signed-off-by: Nathan Gendron <nato@coderabbit.ai>
@NatoBoram
NatoBoram added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit 493a6d8 Jun 18, 2026
3 checks passed
@NatoBoram
NatoBoram deleted the feature/composite branch June 18, 2026 04:58
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