Skip to content

v1.0.10 - #40

Merged
yilmaztayfun merged 2 commits into
release-v1.0from
master
Jul 14, 2026
Merged

v1.0.10#40
yilmaztayfun merged 2 commits into
release-v1.0from
master

Conversation

@yilmaztayfun

@yilmaztayfun yilmaztayfun commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Add feature-folder based update mode and adjust API client configuration for improved connectivity.

New Features:

  • Support updating components by feature folder via new --folder/-d option to the update command, independent of Git status.
  • Resolve feature folder names across all component-type roots, including exact-path and feature-name modes, and list available feature folders for user feedback.

Enhancements:

  • Scan CSX and JSON files within resolved feature folders using glob patterns while ignoring metadata and build artifacts.
  • Improve CLI help and README documentation with examples and explanations for folder-based updates and behavior precedence between flags.
  • Replace direct axios usage with a configured axios instance using HTTP/HTTPS agents that keep connections alive and allow self-signed certificates.

Documentation:

  • Document the new --folder option for wf update, including usage examples, resolution behavior, and precedence over other flags in the README.

ikarakayali and others added 2 commits July 14, 2026 09:28
@yilmaztayfun yilmaztayfun self-assigned this Jul 14, 2026
@yilmaztayfun
yilmaztayfun requested review from a team July 14, 2026 06:34
@sourcery-ai

sourcery-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new --folder/-d mode to wf update that updates all components in a feature folder (across component types, independent of git) with supporting folder resolution utilities, CLI help/docs updates, and switches API calls to use a shared axios client with keep-alive and relaxed HTTPS validation.

Sequence diagram for wf update --folder feature resolution and processing

sequenceDiagram
  actor User
  participant workflow_cli
  participant updateCommand
  participant resolveFeatureFolders
  participant listFeatureFolders
  participant glob
  participant publishComponent

  User->>workflow_cli: wf update --folder name
  workflow_cli->>updateCommand: updateCommand(options)
  updateCommand->>resolveFeatureFolders: resolveFeatureFolders(projectRoot, options.folder)
  resolveFeatureFolders-->>updateCommand: folderDirs
  alt folderDirs is empty
    updateCommand->>listFeatureFolders: listFeatureFolders(projectRoot)
    listFeatureFolders-->>updateCommand: availableNames
    updateCommand->>User: print error and available folders
  else folderDirs found
    updateCommand->>glob: glob(toGlobPattern(dir, **/*.csx))
    glob-->>updateCommand: csxFiles
    updateCommand->>glob: glob(toGlobPattern(dir, **/*.json))
    glob-->>updateCommand: jsonFiles
    loop for each jsonFile
      updateCommand->>publishComponent: publishComponent(baseUrl, componentData)
      publishComponent-->>updateCommand: result
    end
    updateCommand-->>User: summary of updates
  end
Loading

File-Level Changes

Change Details Files
Introduce feature-folder resolution utilities to discover and list feature directories across component types.
  • Add resolveFeatureFolders to resolve a provided name as either an exact path or a feature name across all discovered component roots.
  • Add listFeatureFolders to compute the union of immediate subdirectory names across all component-type roots for use in error messages.
  • Export the new helper functions from the discover module for use by commands.
src/lib/discover.js
Extend wf update to support a --folder/-d mode that updates CSX and JSON files for all components in a feature folder, independent of git state.
  • Introduce --folder precedence logic so that --file overrides --folder, which overrides --all.
  • Resolve the folder name into one or more directories using resolveFeatureFolders and surface helpful errors plus suggestions when resolution fails.
  • Use glob-based scanning to collect CSX files under resolved folders and integrate them into the existing CSX update flow.
  • Use glob-based scanning to collect JSON files under resolved folders (ignoring meta/config/diagram/package JSONs) and feed them into the existing JSON update flow.
  • Add ignore patterns for non-component JSON files and reuse them when searching within folders.
src/commands/update.js
bin/workflow.js
Update CLI documentation to describe the new folder-based update mode and its behavior.
  • Extend README usage examples for wf update with --folder scenarios and precedence rules.
  • Add a new section detailing how to update a whole feature folder without relying on git.
  • Update the behavior matrix to include update --folder <name> semantics.
README.md
Refactor API client usage to use a shared axios instance with keep-alive agents and relaxed HTTPS certificate validation.
  • Create an axios instance configured with HTTP and HTTPS agents that enable keep-alive and disable TLS certificate verification for HTTPS.
  • Update testApiConnection, publishComponent, and reinitializeSystem to use the shared apiClient instead of raw axios calls.
  • Remove per-request User-Agent headers and related package.json dependency from the API module.
src/lib/api.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@yilmaztayfun
yilmaztayfun merged commit 81f2210 into release-v1.0 Jul 14, 2026
2 of 3 checks passed

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a new --folder (-d) option to the update command, allowing users to update all components under a specific feature folder across all component types, independent of Git status. It also refactors the API client in src/lib/api.js to use a custom Axios instance with persistent connections. However, several issues were identified in the review: a critical ReferenceError was introduced in src/lib/api.js due to the removal of the USER_AGENT variable while it is still in use, and there is a security concern regarding the hardcoded disabling of TLS verification. Additionally, it is recommended to add error handling around the new globbing operations in src/commands/update.js and defensive parameter validation in resolveFeatureFolders to prevent runtime crashes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/lib/api.js
Comment on lines +2 to +11
const https = require('node:https');
const http = require('node:http');

// Identifies requests as coming from the CLI (e.g. "vnext-workflow-cli/1.0.0")
const USER_AGENT = `vnext-workflow-cli/${pkg.version}`;
// Create axios instance with custom agents for both HTTP and HTTPS
const apiClient = axios.create({
httpAgent: new http.Agent({ keepAlive: true }),
httpsAgent: new https.Agent({
rejectUnauthorized: false // Allow self-signed certificates
})
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-critical critical

This block introduces two important issues:

  1. Critical Bug (ReferenceError): The USER_AGENT constant and package.json import were removed, but USER_AGENT is still referenced on line 22 in testApiConnection. This will cause a ReferenceError: USER_AGENT is not defined whenever testApiConnection is called, which silently fails the API health check and always reports the connection as down.
  2. Security Vulnerability (Insecure TLS): Hardcoding rejectUnauthorized: false disables SSL/TLS certificate validation for all HTTPS requests, making the CLI vulnerable to Man-in-the-Middle (MitM) attacks.

Recommendation:

  • Restore the USER_AGENT definition and configure it globally on the apiClient instance.
  • Consider making rejectUnauthorized configurable (e.g., via a CLI configuration option or environment variable) rather than hardcoded to false.
Suggested change
const https = require('node:https');
const http = require('node:http');
// Identifies requests as coming from the CLI (e.g. "vnext-workflow-cli/1.0.0")
const USER_AGENT = `vnext-workflow-cli/${pkg.version}`;
// Create axios instance with custom agents for both HTTP and HTTPS
const apiClient = axios.create({
httpAgent: new http.Agent({ keepAlive: true }),
httpsAgent: new https.Agent({
rejectUnauthorized: false // Allow self-signed certificates
})
});
const https = require('node:https');
const http = require('node:http');
const pkg = require('../../package.json');
const USER_AGENT = 'vnext-workflow-cli/' + pkg.version;
// Create axios instance with custom agents for both HTTP and HTTPS
const apiClient = axios.create({
httpAgent: new http.Agent({ keepAlive: true }),
httpsAgent: new https.Agent({
rejectUnauthorized: false // Allow self-signed certificates (consider making this configurable)
}),
headers: {
'User-Agent': USER_AGENT
}
});

Comment thread src/commands/update.js
Comment on lines +161 to +168
for (const dir of folderDirs) {
const files = await glob(toGlobPattern(dir, '**/*.json'), { ignore: ignorePatterns });
jsonFiles.push(...files.map(f => ({
path: f,
type: detectComponentType(f, projectRoot),
fileName: path.basename(f)
})));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The globbing operation for finding JSON files in the feature folders is not wrapped in a try-catch block. If glob throws an error (e.g., due to permission issues), the CLI will crash with an unhandled promise rejection, leaving the spinner hanging. Wrapping this in a try-catch block and calling spinner.fail() ensures graceful error handling.

    try {
      for (const dir of folderDirs) {
        const files = await glob(toGlobPattern(dir, '**/*.json'), { ignore: ignorePatterns });
        jsonFiles.push(...files.map(f => ({
          path: f,
          type: detectComponentType(f, projectRoot),
          fileName: path.basename(f)
        })));
      }
    } catch (error) {
      spinner.fail(chalk.red('Error finding JSON files: ' + error.message));
      return;
    }

Comment thread src/lib/discover.js
Comment on lines +169 to +170
async function resolveFeatureFolders(projectRoot, name) {
const isDir = (p) => fs.existsSync(p) && fs.statSync(p).isDirectory();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To prevent potential runtime crashes (e.g., TypeError: Path must be a string), we should add a defensive check at the beginning of resolveFeatureFolders to ensure name is a valid non-empty string before passing it to path utilities.

Suggested change
async function resolveFeatureFolders(projectRoot, name) {
const isDir = (p) => fs.existsSync(p) && fs.statSync(p).isDirectory();
async function resolveFeatureFolders(projectRoot, name) {
if (typeof name !== 'string' || !name.trim()) {
return [];
}
const isDir = (p) => fs.existsSync(p) && fs.statSync(p).isDirectory();

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

Hey - I've found 2 issues, and left some high level feedback:

  • In src/lib/api.js, USER_AGENT is still referenced in testApiConnection headers but the constant and pkg import were removed, which will cause a runtime reference error—either reintroduce the constant or remove its usage.
  • The new https.Agent is created with rejectUnauthorized: false, which disables TLS certificate validation; consider making this behavior configurable or scoped to explicit dev/test modes instead of the default client configuration.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `src/lib/api.js`, `USER_AGENT` is still referenced in `testApiConnection` headers but the constant and `pkg` import were removed, which will cause a runtime reference error—either reintroduce the constant or remove its usage.
- The new `https.Agent` is created with `rejectUnauthorized: false`, which disables TLS certificate validation; consider making this behavior configurable or scoped to explicit dev/test modes instead of the default client configuration.

## Individual Comments

### Comment 1
<location path="src/lib/api.js" line_range="18-22" />
<code_context>
  */
 async function testApiConnection(baseUrl) {
   try {
-    const response = await axios.get(`${baseUrl}/health`, {
+    const response = await apiClient.get(`${baseUrl}/health`, {
       timeout: 5000,
       headers: { 'User-Agent': USER_AGENT }
     });
</code_context>
<issue_to_address>
**issue (bug_risk):** USER_AGENT is no longer defined, which will throw at runtime before the request is made.

This reference remains from before the package.json import was removed, so testApiConnection will now throw a ReferenceError before the health check runs. Please either restore a USER_AGENT constant (ideally shared with other API calls) or drop this header to align with existing apiClient usage.
</issue_to_address>

### Comment 2
<location path="src/lib/api.js" line_range="6-9" />
<code_context>
-// Identifies requests as coming from the CLI (e.g. "vnext-workflow-cli/1.0.0")
-const USER_AGENT = `vnext-workflow-cli/${pkg.version}`;
+// Create axios instance with custom agents for both HTTP and HTTPS
+const apiClient = axios.create({
+  httpAgent: new http.Agent({ keepAlive: true }),
+  httpsAgent: new https.Agent({ 
+    rejectUnauthorized: false // Allow self-signed certificates
+  })
+});
</code_context>
<issue_to_address>
**🚨 issue (security):** Disabling TLS verification (`rejectUnauthorized: false`) weakens security and may not be appropriate outside of a controlled environment.

This setting causes the client to trust any certificate, including invalid or malicious ones. If you only need this for local/self‑signed development, please gate it behind configuration and keep strict verification as the default. Alternatively, support a custom CA bundle for self‑signed certs instead of disabling verification entirely.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/lib/api.js
Comment on lines 18 to 22
async function testApiConnection(baseUrl) {
try {
const response = await axios.get(`${baseUrl}/health`, {
const response = await apiClient.get(`${baseUrl}/health`, {
timeout: 5000,
headers: { 'User-Agent': USER_AGENT }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): USER_AGENT is no longer defined, which will throw at runtime before the request is made.

This reference remains from before the package.json import was removed, so testApiConnection will now throw a ReferenceError before the health check runs. Please either restore a USER_AGENT constant (ideally shared with other API calls) or drop this header to align with existing apiClient usage.

Comment thread src/lib/api.js
Comment on lines +6 to +9
const apiClient = axios.create({
httpAgent: new http.Agent({ keepAlive: true }),
httpsAgent: new https.Agent({
rejectUnauthorized: false // Allow self-signed certificates

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 issue (security): Disabling TLS verification (rejectUnauthorized: false) weakens security and may not be appropriate outside of a controlled environment.

This setting causes the client to trust any certificate, including invalid or malicious ones. If you only need this for local/self‑signed development, please gate it behind configuration and keep strict verification as the default. Alternatively, support a custom CA bundle for self‑signed certs instead of disabling verification entirely.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 13694fc8-f2b6-4734-a5e7-5ff5c4ce6e2b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch master

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.

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