Skip to content

fix: update the registry url in the cli#2134

Merged
JivusAyrus merged 1 commit intomainfrom
suvij/change-registry-url
Aug 12, 2025
Merged

fix: update the registry url in the cli#2134
JivusAyrus merged 1 commit intomainfrom
suvij/change-registry-url

Conversation

@JivusAyrus
Copy link
Copy Markdown
Member

@JivusAyrus JivusAyrus commented Aug 12, 2025

Summary by CodeRabbit

  • Chores
    • Updated the default plugin registry endpoint to the production service (cosmo-registry.wundergraph.com) when no environment override is set.
    • Users without PLUGIN_REGISTRY_URL will now connect to the production registry by default.
    • No changes to other configuration behaviors or headers.
    • No action required unless you rely on the previous staging endpoint; you can still override via PLUGIN_REGISTRY_URL.

Checklist

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 12, 2025

Walkthrough

Updated the default plugin registry URL in config.ts to use cosmo-registry.wundergraph.com when PLUGIN_REGISTRY_URL is unset. No other logic or signatures changed.

Changes

Cohort / File(s) Summary
Config default registry URL update
cli/src/core/config.ts
Changed default config.pluginRegistryURL from cosmo-registry.wundergraph-staging.workers.dev to cosmo-registry.wundergraph.com; env override (PLUGIN_REGISTRY_URL) unchanged; no other modifications.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3c1aef and 9432989.

📒 Files selected for processing (1)
  • cli/src/core/config.ts (1 hunks)
🔇 Additional comments (1)
cli/src/core/config.ts (1)

37-37: Ignore adding an HTTPS scheme to pluginRegistryURL

The pluginRegistryURL value is only used for Docker commands (docker login, docker logout, image tags), which expect a hostname (and optional namespace) without any http(s):// prefix. Introducing https:// would break those workflows rather than fix them.

Likely an incorrect or invalid review comment.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch suvij/change-registry-url

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@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: 0

🔭 Outside diff range comments (1)
cli/src/core/config.ts (1)

40-46: Avoid sending Authorization: Bearer undefined when apiKey is absent

When COSMO_API_KEY is unset, the header becomes a literal "Bearer undefined". That’s noisy, can confuse servers, and may leak into logs.

Refactor to include the header only when a key is present:

-export const getBaseHeaders = (): HeadersInit => {
-  return {
-    'user-agent': `cosmo-cli/${info.version}`,
-    authorization: 'Bearer ' + config.apiKey,
-    'cosmo-org-slug': getLoginDetails()?.organizationSlug || '',
-  };
-};
+export const getBaseHeaders = (): HeadersInit => {
+  const headers: Record<string, string> = {
+    'user-agent': `cosmo-cli/${info.version}`,
+    'cosmo-org-slug': getLoginDetails()?.organizationSlug || '',
+  };
+  if (config.apiKey) {
+    headers.authorization = `Bearer ${config.apiKey}`;
+  }
+  return headers;
+};
🧹 Nitpick comments (2)
cli/src/core/config.ts (2)

23-38: Optional: support COSMO_PLUGIN_REGISTRY_URL (and keep PLUGIN_REGISTRY_URL as a fallback) for env var consistency

Most envs here use a COSMO_* prefix. Consider supporting COSMO_PLUGIN_REGISTRY_URL first while remaining backward compatible.

You can implement this as:

-  pluginRegistryURL: process.env.PLUGIN_REGISTRY_URL || 'https://cosmo-registry.wundergraph.com',
+  // Prefer COSMO_* naming; keep backward-compatible fallback
+  pluginRegistryURL:
+    process.env.COSMO_PLUGIN_REGISTRY_URL
+    || process.env.PLUGIN_REGISTRY_URL
+    || 'https://cosmo-registry.wundergraph.com',

1-47: Follow-up: Update tests and docs per the PR checklist

The change switches the default registry to production. Please add/update:

  • A small unit/integration test that verifies the default resolves to the production registry when PLUGIN_REGISTRY_URL is unset.
  • Docs in cosmo-docs outlining the new default and the env var overrides.

I can draft the tests and a short docs snippet if you confirm the preferred env var naming (keep PLUGIN_REGISTRY_URL only vs. adding COSMO_PLUGIN_REGISTRY_URL).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3c1aef and 9432989.

📒 Files selected for processing (1)
  • cli/src/core/config.ts (1 hunks)
🔇 Additional comments (1)
cli/src/core/config.ts (1)

37-37: Ignore scheme addition for pluginRegistryURL; keep host-only registry reference

The default pluginRegistryURL is only ever used to construct OCI image references and invoke Docker commands (login, logout). Docker registry references and image tags must be hostname (and optional namespace/path) without an http:// or https:// prefix—adding a scheme would break tag parsing and docker login. A search also shows no usage of new URL(...) or fetch(...) with this value.

• cli/src/core/config.ts: defines the default as 'cosmo-registry.wundergraph.com'
• cli/src/commands/router/commands/plugin/commands/publish.ts: uses config.pluginRegistryURL for image tags and Docker CLI calls

No change required here.

Likely an incorrect or invalid review comment.

@JivusAyrus JivusAyrus merged commit 063de73 into main Aug 12, 2025
27 checks passed
@JivusAyrus JivusAyrus deleted the suvij/change-registry-url branch August 12, 2025 14:29
@Noroth Noroth mentioned this pull request Sep 30, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants