Skip to content

v1.0.11 - #42

Merged
yilmaztayfun merged 2 commits into
release-v1.0from
master
Aug 3, 2026
Merged

v1.0.11#42
yilmaztayfun merged 2 commits into
release-v1.0from
master

Conversation

@yilmaztayfun

@yilmaztayfun yilmaztayfun commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Enhancements:

  • Load the CLI version from package.json to construct a consistent User-Agent string for outgoing requests.

yilmaztayfun and others added 2 commits August 3, 2026 09:15
The axios refactor in dc5211f dropped the USER_AGENT constant but left a
reference to it in testApiConnection's headers. That threw a ReferenceError
on every health check, which the surrounding catch swallowed into a plain
`false` — so the connection test reported the API as unreachable even when
it was up.

Restore the constant and set it as a default header on the shared axios
instance so all three calls (/health, publish, re-initialize) send it and
it cannot be dropped piecemeal again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix(api): restore User-Agent header on API requests
@yilmaztayfun yilmaztayfun self-assigned this Aug 3, 2026
@yilmaztayfun
yilmaztayfun requested review from a team August 3, 2026 06:17
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@sourcery-ai

sourcery-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a CLI-specific User-Agent header to all axios requests via the shared apiClient and removes the now-redundant per-call header in the health check helper.

Sequence diagram for apiClient User-Agent header handling

sequenceDiagram
    participant CLI
    participant apiClient
    participant Server

    CLI->>apiClient: apiClient.get(baseUrl + /health)
    activate apiClient
    apiClient->>Server: GET /health
    Server-->>apiClient: 200 OK
    deactivate apiClient
    Note right of apiClient: All requests include header\nUser-Agent: vnext-workflow-cli/<pkg.version>
Loading

File-Level Changes

Change Details Files
Introduce a centralized CLI User-Agent header on the shared axios client and simplify the health-check request options.
  • Import package.json to read the current CLI version for use in request identification.
  • Define a USER_AGENT constant formatted as "vnext-workflow-cli/" to tag outgoing requests.
  • Attach a default 'User-Agent' header to the axios client configuration so all requests carry the CLI identifier automatically.
  • Remove the per-request 'User-Agent' header override in testApiConnection, relying on the apiClient defaults instead.
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

@coderabbitai

coderabbitai Bot commented Aug 3, 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 Plus

Run ID: cf51f468-9b50-4c8f-8938-f582c5e82b01

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

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.

@yilmaztayfun
yilmaztayfun merged commit b54292c into release-v1.0 Aug 3, 2026
3 of 4 checks passed

@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 1 issue, and left some high level feedback:

  • Importing ../../package.json directly from src/lib/api.js can cause issues with some bundlers/runtimes; consider passing the version in via configuration or environment to decouple the library code from the repository layout.
  • By setting the User-Agent on the axios instance, all consumers of apiClient will now send this CLI-specific header; if apiClient is shared beyond the CLI context, consider scoping this header to CLI usage only or allowing an easy override.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Importing `../../package.json` directly from `src/lib/api.js` can cause issues with some bundlers/runtimes; consider passing the version in via configuration or environment to decouple the library code from the repository layout.
- By setting the `User-Agent` on the axios instance, all consumers of `apiClient` will now send this CLI-specific header; if `apiClient` is shared beyond the CLI context, consider scoping this header to CLI usage only or allowing an easy override.

## Individual Comments

### Comment 1
<location path="src/lib/api.js" line_range="15" />
<code_context>
     rejectUnauthorized: false // Allow self-signed certificates
-  })
+  }),
+  headers: { 'User-Agent': USER_AGENT }
 });

</code_context>
<issue_to_address>
**issue (bug_risk):** Setting `headers` at the instance level may override axios’s per-method default headers.

Passing a flat `headers` object into `axios.create` can overwrite axios’s per-method defaults (e.g. `Content-Type` on POST/PUT). To avoid dropping these, either set `apiClient.defaults.headers.common['User-Agent'] = USER_AGENT` after creation, or use `headers: { common: { 'User-Agent': USER_AGENT } }` so existing defaults are preserved.
</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
rejectUnauthorized: false // Allow self-signed certificates
})
}),
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): Setting headers at the instance level may override axios’s per-method default headers.

Passing a flat headers object into axios.create can overwrite axios’s per-method defaults (e.g. Content-Type on POST/PUT). To avoid dropping these, either set apiClient.defaults.headers.common['User-Agent'] = USER_AGENT after creation, or use headers: { common: { 'User-Agent': USER_AGENT } } so existing defaults are preserved.

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