Skip to content

fix: build runit#154

Merged
rsonghuster merged 1 commit into
masterfrom
build-runit
May 20, 2026
Merged

fix: build runit#154
rsonghuster merged 1 commit into
masterfrom
build-runit

Conversation

@mozhou52
Copy link
Copy Markdown
Collaborator

@mozhou52 mozhou52 commented May 19, 2026

fix: build runit

Summary by CodeRabbit

  • New Features

    • Detect and run Cloud Build YAML to drive an automated YAML-to-deploy build flow with an integrated build/deploy runner.
    • Expose a model command in the CLI and update model-related help text.
  • Bug Fixes

    • Fixed build command help formatting so Examples and related options display correctly.
  • Chores

    • Bumped component version to 0.1.21.
    • Added new runtime dependencies to support the build workflow.
  • Tests

    • Updated test expectation to reflect corrected help guidance for invalid subcommands.

Review Change Stack

@mozhou52 mozhou52 requested a review from rsonghuster May 19, 2026 03:33
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c3350dfd-4fc2-4955-9eff-23e58deb2176

📥 Commits

Reviewing files that changed from the base of the PR and between 350e78e and d05724d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • __tests__/ut/commands/model_test.ts
  • package.json
  • publish.yaml
  • src/commands-help/build.ts
  • src/commands-help/index.ts
  • src/commands-help/model.ts
  • src/index.ts
  • src/interface/index.ts
  • src/subCommands/build/index.ts
  • src/subCommands/build/runit/index.ts
  • src/subCommands/build/runit/interface/index.ts
  • src/subCommands/model/index.ts
✅ Files skipped from review due to trivial changes (2)
  • publish.yaml
  • tests/ut/commands/model_test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • package.json
  • src/subCommands/build/runit/interface/index.ts
  • src/subCommands/build/index.ts
  • src/subCommands/build/runit/index.ts

📝 Walkthrough

Walkthrough

Detects a cloud-build YAML (user-provided or default), parses build/runtime props, and runs a new Runit wrapper that calls @serverless-devs/docker-image-builder to build/deploy an image; adds types, dependencies, CLI help fixes, command wiring, and entry-point routing to use the YAML flow.

Changes

Cloud Build Deployment Support

Layer / File(s) Summary
Type contracts for cloud build flow
src/interface/index.ts, src/subCommands/build/runit/interface/index.ts
IProps adds optional buildDir; new RunitInput and IProps describe region, credential, props, userAgent, baseDir, and nested build/runtime configuration shapes.
External dependencies and registry override
package.json, package.json#resolutions, publish.yaml
Adds undici and @serverless-devs/docker-image-builder dependencies and a resolutions registry override for the docker-image-builder package; component Version bumped to 0.1.21.
BuilderFactory: imports, CLI args, YAML resolution, and runit flow
src/subCommands/build/index.ts
Adds imports/wiring, parses inputs.args for --cloud-build-config and --debug-instance, implements findCloudBuildYaml() to resolve/validate YAML path, and runit() to load/normalize YAML props, obtain credentials, assemble Runit inputs, deploy via Runit.deploy, and log the resulting image.
Runit deployment class
src/subCommands/build/runit/index.ts
Adds Runit class with constructor storing RunitInput and async deploy(debugInstance) that extracts runtime/build fields and calls @serverless-devs/docker-image-builder's build(...), returning { image }.
CLI help, command map, and model wiring
src/commands-help/*, src/commands-help/index.ts, src/subCommands/model/*, __tests__/ut/commands/*, src/index.ts
Fixes build help examples and adds --cloud-build-config/--debug-instance option descriptions; registers model in help map and updates model help/validation error text; updates a test to match new help text; src/index.ts now short-circuits to the cloud-build YAML flow when found.

Sequence Diagram

sequenceDiagram
  participant CLI
  participant BuilderFactory
  participant FS
  participant Runit
  participant DockerImageBuilder
  CLI->>BuilderFactory: invoke `build` with inputs/args
  BuilderFactory->>BuilderFactory: parse argv (--cloud-build-config, --debug-instance)
  BuilderFactory->>FS: findCloudBuildYaml() -> resolve path or fallback
  alt YAML found
    BuilderFactory->>FS: read YAML file
    BuilderFactory->>BuilderFactory: parse/normalize props
    BuilderFactory->>Runit: construct RunitInput (region, credential, props, userAgent)
    Runit->>DockerImageBuilder: build(..., enableSsh=debugInstance, props, runtime)
    DockerImageBuilder-->>Runit: return image metadata
    Runit-->>BuilderFactory: { image }
    BuilderFactory-->>CLI: return deployed image info
  else no YAML
    BuilderFactory-->>CLI: continue existing builder selection
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • rsonghuster

Poem

🐰 I sniffed a YAML beneath your tree,
cloud-build hums, "let the image be free!"
Runit hops in with a cheerful drum,
builder clicks, the painted container hums,
logs wink green—deployments dance with glee.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: build runit' is vague and overly generic, failing to clearly describe what was fixed or the scope of changes in the changeset. Revise the title to be more specific, such as 'feat: add cloud build support with Runit deployment' or 'feat: add Runit builder for cloud build YAML configuration'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build-runit

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

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: 6

🤖 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 `@package.json`:
- Line 58: Update the dependency entry for
"`@serverless-devs/docker-image-builder`" in package.json to remove the caret and
pin the exact pre-release version "0.0.0-20260518-164317-160dd89efac1" so
installs are reproducible; locate the dependency key
"`@serverless-devs/docker-image-builder`" and replace the version string
"^0.0.0-20260518-164317-160dd89efac1" with the exact version string
"0.0.0-20260518-164317-160dd89efac1".

In `@src/commands-help/build.ts`:
- Around line 12-13: Add the two new CLI flags shown in the example usage to the
help.option table so they appear in help output: add entries for
"--cloud-build-config" (with a short description like "Path to cloud build
config file") and "--debug-instance" (with a description like "Enable debug
instance for cloud build") in the help.option structure inside
src/commands-help/build.ts so they are listed alongside the other options when
using the help command.

In `@src/index.ts`:
- Line 136: The debug log currently prints the entire inputs object via
logger.debug(`inputs: ${JSON.stringify(inputs, null, 2)}`) which may leak
secrets; change this to only log a redacted or whitelisted subset: create a
sanitized copy (e.g., redact keys like apiKey, password, token) or build an
object with only non-sensitive fields and log that instead; update the call to
logger.debug to use the sanitizedInputs (or whitelist object) and keep the
original inputs variable untouched; reference logger.debug and the inputs
variable when making the change.

In `@src/subCommands/build/index.ts`:
- Around line 81-82: The code is logging full build configuration which can leak
secrets; add a sanitizer (e.g., sanitizeConfig or maskSecrets) and use it
wherever buildConfig is logged (the logger.debug calls in the build subcommand,
including the existing Build config log and the later log at the other call
site) to redact fields such as AccessKeySecret, password, token, secret,
privateKey, registryPassword, and any keys matching /key|secret|token|password/i
before calling JSON.stringify; update the logger.debug invocations to serialize
the sanitized object instead of the raw buildConfig.
- Around line 75-79: Guard against a null/empty cloudBuildYaml path before
calling fs.readFileSync: check this.cloudBuildYamlAbsPath (assigned to
buildYamlPath) for null/undefined/empty string and throw or return a clear,
actionable error (e.g., "cloud build yaml path not provided") before attempting
to read; then proceed to call fs.readFileSync and parse into buildConfig
(yaml.load) only after the presence check passes so readFileSync cannot throw
due to a missing path.

In `@src/subCommands/build/runit/index.ts`:
- Around line 22-26: The code is passing a potentially relative build.code
(aliased to codeUri) into dir which depends on CWD; change the code to resolve
build.code to an absolute path against baseDir before using it (e.g., compute an
absoluteCode = path.resolve(baseDir, codeUri || "") or path.join(baseDir,
codeUri) and pass absoluteCode as dir), updating both occurrences where dir:
codeUri is used (look for codeUri and the this.inputs.props.build destructure
and the subsequent object that sets dir) so relative cloud-build config paths
work in non-default execution contexts.
🪄 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

Run ID: eaf98d27-1432-40ff-bca5-afd1b2394a2c

📥 Commits

Reviewing files that changed from the base of the PR and between 55a57a5 and 0f46c9c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • package.json
  • publish.yaml
  • src/commands-help/build.ts
  • src/index.ts
  • src/interface/index.ts
  • src/subCommands/build/index.ts
  • src/subCommands/build/runit/index.ts
  • src/subCommands/build/runit/interface/index.ts

Comment thread package.json
Comment thread src/commands-help/build.ts
Comment thread src/index.ts Outdated

public async build(inputs: IInputs) {
await super.handlePreRun(inputs, false);
logger.debug(`inputs: ${JSON.stringify(inputs, null, 2)}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Do not debug-log the full inputs payload.

This can leak credentials/secrets into logs. Log only non-sensitive fields (or a redacted clone).

🤖 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/index.ts` at line 136, The debug log currently prints the entire inputs
object via logger.debug(`inputs: ${JSON.stringify(inputs, null, 2)}`) which may
leak secrets; change this to only log a redacted or whitelisted subset: create a
sanitized copy (e.g., redact keys like apiKey, password, token) or build an
object with only non-sensitive fields and log that instead; update the call to
logger.debug to use the sanitizedInputs (or whitelist object) and keep the
original inputs variable untouched; reference logger.debug and the inputs
variable when making the change.

Comment on lines +75 to +79
const buildYamlPath = this.cloudBuildYamlAbsPath;

try {
const buildYamlContent = fs.readFileSync(buildYamlPath, 'utf8');
const buildConfig = yaml.load(buildYamlContent) as any;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add an explicit null/empty guard for buildYamlPath before readFileSync.

this.cloudBuildYamlAbsPath is nullable; calling readFileSync without a guard can throw a non-actionable runtime error.

Suggested diff
   async runit() {
     const buildYamlPath = this.cloudBuildYamlAbsPath;
+    if (!buildYamlPath) {
+      throw new Error('Cloud build config path is not initialized. Call findCloudBuildYaml() first.');
+    }

     try {
       const buildYamlContent = fs.readFileSync(buildYamlPath, 'utf8');
🤖 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/subCommands/build/index.ts` around lines 75 - 79, Guard against a
null/empty cloudBuildYaml path before calling fs.readFileSync: check
this.cloudBuildYamlAbsPath (assigned to buildYamlPath) for null/undefined/empty
string and throw or return a clear, actionable error (e.g., "cloud build yaml
path not provided") before attempting to read; then proceed to call
fs.readFileSync and parse into buildConfig (yaml.load) only after the presence
check passes so readFileSync cannot throw due to a missing path.

Comment thread src/subCommands/build/index.ts Outdated
Comment on lines +81 to +82
logger.debug(`Build config: ${JSON.stringify(buildConfig, null, 2)}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Stop logging full configs/inputs because they expose secrets.

These logs can leak AccessKeySecret, registry passwords, and other sensitive fields into debug output. Mask or omit sensitive keys before logging.

Also applies to: 111-111

🤖 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/subCommands/build/index.ts` around lines 81 - 82, The code is logging
full build configuration which can leak secrets; add a sanitizer (e.g.,
sanitizeConfig or maskSecrets) and use it wherever buildConfig is logged (the
logger.debug calls in the build subcommand, including the existing Build config
log and the later log at the other call site) to redact fields such as
AccessKeySecret, password, token, secret, privateKey, registryPassword, and any
keys matching /key|secret|token|password/i before calling JSON.stringify; update
the logger.debug invocations to serialize the sanitized object instead of the
raw buildConfig.

Comment thread src/subCommands/build/runit/index.ts Outdated
Comment on lines +22 to +26
code: codeUri,
setup,
timeoutMinutes,
baseContainerConfig
} = this.inputs.props.build;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Resolve build.code to an absolute path before passing dir.

dir: codeUri depends on current working directory. Relative paths from cloud-build config can break in non-default execution contexts; resolve against baseDir first.

Suggested diff
+import path from 'path';
...
-    await build({
+    const resolvedCodeDir = path.isAbsolute(codeUri) ? codeUri : path.resolve(this.inputs.baseDir, codeUri);
+
+    await build({
...
-      dir: codeUri,
+      dir: resolvedCodeDir,

Also applies to: 44-44

🤖 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/subCommands/build/runit/index.ts` around lines 22 - 26, The code is
passing a potentially relative build.code (aliased to codeUri) into dir which
depends on CWD; change the code to resolve build.code to an absolute path
against baseDir before using it (e.g., compute an absoluteCode =
path.resolve(baseDir, codeUri || "") or path.join(baseDir, codeUri) and pass
absoluteCode as dir), updating both occurrences where dir: codeUri is used (look
for codeUri and the this.inputs.props.build destructure and the subsequent
object that sets dir) so relative cloud-build config paths work in non-default
execution contexts.

@mozhou52 mozhou52 force-pushed the build-runit branch 3 times, most recently from 350e78e to 583cefb Compare May 19, 2026 05:56
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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 58: The package.json currently pins a pre-release dependency
"`@serverless-devs/docker-image-builder`" at version
"0.0.0-20260518-164317-160dd89efac1"; replace this pre-release with a stable
semver release (or a caret/tilde range to the intended stable version) if this
is meant for production, or add a clear comment in package.json / project docs
explaining why this pre-release is required and a migration plan to a stable
release; ensure any CI/CD or lockfile updates are committed so the change is
effective.
- Line 57: Update the "undici" dependency entry in package.json from the pinned
^5.28.5 to a current 8.x version (e.g., ^8.3.0 or the latest), then run your
package manager to refresh lockfiles (npm install / npm update or yarn install)
and run the test suite to ensure no breaking changes; target the "undici"
dependency line in package.json to make this change and verify any code that
imports undici remains compatible with the newer major version.

In `@src/subCommands/build/runit/interface/index.ts`:
- Around line 4-29: Remove the redundant top-level region property from the
RunitInput interface: delete the region field in the RunitInput declaration so
callers use props.region consistently; update any construction/assignment code
that currently duplicates props.region into RunitInput (the place that populates
RunitInput) to stop setting that top-level region, and ensure all code continues
to read region from props.region only (reference: RunitInput and IProps.region).
🪄 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

Run ID: e1558d55-ce2c-464d-ba13-fe508ea4e8d6

📥 Commits

Reviewing files that changed from the base of the PR and between 0f46c9c and 350e78e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • package.json
  • publish.yaml
  • src/commands-help/build.ts
  • src/index.ts
  • src/interface/index.ts
  • src/subCommands/build/index.ts
  • src/subCommands/build/runit/index.ts
  • src/subCommands/build/runit/interface/index.ts
✅ Files skipped from review due to trivial changes (1)
  • publish.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/interface/index.ts
  • src/commands-help/build.ts
  • src/subCommands/build/runit/index.ts
  • src/index.ts
  • src/subCommands/build/index.ts

Comment thread package.json
"temp-dir": "^2.0.0",
"tty-table": "^4.2.3",
"uuid": "^9.0.1",
"undici": "^5.28.5",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the latest version of undici npm package and are there any known security vulnerabilities in version 5.28.5?

💡 Result:

Latest version (as of 2026-05-19): undici 8.3.0 is the latest published version on npm [1]. Known security vulnerabilities in undici 5.28.5: Snyk’s vulnerability advisory indicates multiple issues affecting undici versions earlier than 5.28.5 (e.g., Insecure Randomness via Math.random boundary selection, and others) and states that they are fixed by upgrading to 5.28.5 (or higher) [2]. Additionally, the undici project’s own “Security Release” notes for v5.28.3 mention a CVE-2024-24758 related to Proxy-Authorization header not cleared on cross-origin redirect, which would be relevant to that older patch line [3]. For undici specifically at 5.28.5, Snyk does not show a dedicated page in the retrieved sources that lists “direct vulnerabilities” for exactly 5.28.5; however, the above Snyk findings clearly indicate that the high-level issues disclosed for nearby 5.28.x versions are addressed by upgrading to 5.28.5 [2]. If you need an exhaustive CVE list that explicitly enumerates every issue affecting exactly 5.28.5, I can run one more targeted search focused on “undici@5.28.5 vulnerabilities / CVEs” in a subsequent step.

Citations:


Update undici to a current version.

The undici dependency is pinned to version ^5.28.5, but the latest version is 8.3.0. This is 3 major versions behind. While 5.28.5 itself has no known vulnerabilities, the significant version gap means missing important security patches, bug fixes, and improvements. Update to version 8.x or the latest available.

🤖 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` at line 57, Update the "undici" dependency entry in
package.json from the pinned ^5.28.5 to a current 8.x version (e.g., ^8.3.0 or
the latest), then run your package manager to refresh lockfiles (npm install /
npm update or yarn install) and run the test suite to ensure no breaking
changes; target the "undici" dependency line in package.json to make this change
and verify any code that imports undici remains compatible with the newer major
version.

Comment thread package.json Outdated
"tty-table": "^4.2.3",
"uuid": "^9.0.1",
"undici": "^5.28.5",
"@serverless-devs/docker-image-builder": "0.0.0-20260518-164317-160dd89efac1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Consider stability implications of using a pre-release dependency.

The @serverless-devs/docker-image-builder dependency uses a pre-release version (0.0.0-20260518-164317-160dd89efac1). Pre-release versions may lack stability guarantees, could contain undocumented breaking changes, and may not receive long-term support.

If this is for testing or development purposes, ensure it's replaced with a stable release before production deployment. If the pre-release is intentional, document the rationale and plan for migrating to a stable version.

🤖 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` at line 58, The package.json currently pins a pre-release
dependency "`@serverless-devs/docker-image-builder`" at version
"0.0.0-20260518-164317-160dd89efac1"; replace this pre-release with a stable
semver release (or a caret/tilde range to the intended stable version) if this
is meant for production, or add a clear comment in package.json / project docs
explaining why this pre-release is required and a migration plan to a stable
release; ensure any CI/CD or lockfile updates are committed so the change is
effective.

Comment on lines +4 to +29
export interface RunitInput extends _IInputs {
region: string;
credential: ICredentials;
props: IProps;
userAgent: string;
baseDir: string;
}

export interface IProps {
region: string;
build: {
setup: string;
code: string;
timeoutMinutes?: number;
buildSpec?: string;
baseContainerConfig?: ICustomContainerConfig;
};
runtime: {
registryMode?: 'oci' | 'fc-registry';
image: string;
username?: string;
password?: string;
cpu?: string | number;
memory?: string | number;
};
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check usage of region fields in RunitInput and IProps to determine if duplication is intentional

# Search for accesses to top-level region
echo "=== Top-level region usage (input.region) ==="
rg -nP --type=ts -C3 '\binput\.region\b' src/subCommands/build/

# Search for accesses to nested props.region
echo -e "\n=== Nested props.region usage (props.region or input.props.region) ==="
rg -nP --type=ts -C3 '\bprops\.region\b' src/subCommands/build/

# Search for RunitInput construction/usage
echo -e "\n=== RunitInput construction sites ==="
ast-grep --pattern 'const $_ = {
  $$$
  region: $_,
  $$$
  props: {
    $$$
    region: $_,
    $$$
  }
  $$$
}'

Repository: devsapp/fc3

Length of output: 1095


🏁 Script executed:

# Search more comprehensively for uses of the top-level region field
# Check if this.inputs.region or input.region appears anywhere in the codebase
echo "=== Searching for top-level region field access ==="
rg -nP --type=ts '\b(this\.inputs\.region|input\.region)\b' src/subCommands/build/

echo -e "\n=== Check RunitInput usage context ==="
rg -nP --type=ts -B5 -A5 'RunitInput' src/subCommands/build/ | head -60

echo -e "\n=== Verify if top-level region is used in Runit class methods ==="
rg -nP --type=ts 'this\.inputs\.region' src/

Repository: devsapp/fc3

Length of output: 2657


Remove the unused region field from RunitInput interface.

The region field at the top level of RunitInput (line 5) is never accessed anywhere in the codebase. The implementation always reads from props.region instead. The top-level field is populated from props.region during construction (line 101 in src/subCommands/build/index.ts) but never used, creating redundant duplication. Remove this field to improve clarity.

🤖 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/subCommands/build/runit/interface/index.ts` around lines 4 - 29, Remove
the redundant top-level region property from the RunitInput interface: delete
the region field in the RunitInput declaration so callers use props.region
consistently; update any construction/assignment code that currently duplicates
props.region into RunitInput (the place that populates RunitInput) to stop
setting that top-level region, and ensure all code continues to read region from
props.region only (reference: RunitInput and IProps.region).

@mozhou52 mozhou52 force-pushed the build-runit branch 5 times, most recently from 5680c42 to 4bb9fa3 Compare May 19, 2026 06:47
@rsonghuster rsonghuster merged commit 6e5c531 into master May 20, 2026
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.

2 participants