Skip to content

feat: inject Atlassian cloud ID server-side#187

Open
i-am-thor[bot] wants to merge 7 commits into
mainfrom
feat/atlassian-cloudid-env
Open

feat: inject Atlassian cloud ID server-side#187
i-am-thor[bot] wants to merge 7 commits into
mainfrom
feat/atlassian-cloudid-env

Conversation

@i-am-thor
Copy link
Copy Markdown
Contributor

@i-am-thor i-am-thor Bot commented Jun 4, 2026

Summary

  • require ATLASSIAN_CLOUD_ID whenever Atlassian MCP auth is configured
  • hide cloudId from Atlassian tool schemas and approval payloads shown to the model
  • inject the configured cloudId into outbound Atlassian MCP calls and update docs/CI env wiring

Testing

  • pnpm test packages/common/src/proxies.test.ts packages/remote-cli/src/mcp-handler.test.ts packages/runner/src/trigger.test.ts
  • pnpm typecheck
  • GitHub Actions: Unit Tests, Core E2E

AI-generated — verify before acting. View Thor context

i-am-thor Bot and others added 3 commits June 4, 2026 11:27
Co-authored-by: Son Dao <son.dao@katalon.com>
Co-authored-by: Son Dao <son.dao@katalon.com>
Co-authored-by: Son Dao <son.dao@katalon.com>
Comment thread packages/common/src/proxies.test.ts Outdated

const FULL_ENV: NodeJS.ProcessEnv = {
ATLASSIAN_AUTH: "Basic global",
ATLASSIAN_CLOUD_ID: "katalon.atlassian.net",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
ATLASSIAN_CLOUD_ID: "katalon.atlassian.net",
ATLASSIAN_CLOUD_ID: "acme.atlassian.net",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I see the suggestion. This PR originated from a Slack request by slack:U05QSJ4U0PM, so per the run ownership rule I am waiting for requester confirmation before changing the branch. If they confirm, I will fold the agreed test-fixture cleanup into one follow-up pass.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. I updated the test fixture cloud ID to acme.atlassian.net.


AI-generated — verify before acting. View Thor context

Comment thread packages/common/src/proxies.test.ts Outdated
"https://mcp.atlassian.com/v1/mcp",
);
expect(resolveProxyConfig("atlassian", undefined, FULL_ENV)?.atlassianCloudId).toBe(
"katalon.atlassian.net",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"katalon.atlassian.net",
"acme.atlassian.net",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noted. Same constraint here: this branch is currently owned by the original Slack requester (slack:U05QSJ4U0PM), so I am pausing code changes until they confirm. If confirmed, I will batch the constant/test cleanup together.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. The expectation now uses acme.atlassian.net too.


AI-generated — verify before acting. View Thor context

Comment thread packages/common/src/proxies.test.ts Outdated
const env = {
ATLASSIAN_AUTH: "Basic global",
ATLASSIAN_AUTH_LABS: "Basic labs",
ATLASSIAN_CLOUD_ID: "katalon.atlassian.net",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
ATLASSIAN_CLOUD_ID: "katalon.atlassian.net",
ATLASSIAN_CLOUD_ID: "acme.atlassian.net",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. I am holding follow-up edits until the original requester (slack:U05QSJ4U0PM) confirms the PR direction, then I can apply these test fixture simplifications in one pass.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. I switched that test env fixture to acme.atlassian.net.


AI-generated — verify before acting. View Thor context

Comment thread packages/common/src/proxies.test.ts Outdated
GRAFANA_SERVICE_ACCOUNT_TOKEN_LABS: "labs-token",
GRAFANA_ORG_ID_LABS: "7",
ATLASSIAN_AUTH_LABS: "Basic labs",
ATLASSIAN_CLOUD_ID: "katalon.atlassian.net",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
ATLASSIAN_CLOUD_ID: "katalon.atlassian.net",
ATLASSIAN_CLOUD_ID: "acme.atlassian.net",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I have the suggestion noted, but I am waiting for confirmation from the original Slack requester (slack:U05QSJ4U0PM) before changing this branch. If confirmed, I will fold this into the same cleanup pass.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. Same fixture cleanup applied here.


AI-generated — verify before acting. View Thor context

Comment thread packages/common/src/proxies.ts Outdated
if (name === "atlassian") {
const auth = scopedEnv(env, "ATLASSIAN_AUTH", profile);
if (!auth.value) return undefined;
const cloudId = envValue(env, "ATLASSIAN_CLOUD_ID");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should use scoped env var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. The current branch intentionally keeps ATLASSIAN_CLOUD_ID global to match the requester’s “keep it simple” direction. I can revisit scoped variants too, but per run ownership I am waiting for confirmation from the original Slack requester (slack:U05QSJ4U0PM) before changing the implementation.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. ATLASSIAN_CLOUD_ID now follows the same profile-aware pattern as auth: ATLASSIAN_CLOUD_ID_<PROFILE> overrides the global value, with global fallback.


AI-generated — verify before acting. View Thor context

Comment thread packages/common/src/proxies.ts Outdated
},
allow: ATLASSIAN_ALLOW,
approve: ATLASSIAN_APPROVE,
atlassianCloudId: cloudId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
atlassianCloudId: cloudId,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noted. I am pausing implementation changes until the original Slack requester (slack:U05QSJ4U0PM) confirms the follow-up direction; if confirmed, I can simplify this path in a follow-up update.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. I removed the extra atlassianCloudId field and resolve the configured cloud ID at call time instead.


AI-generated — verify before acting. View Thor context

Comment thread packages/remote-cli/src/mcp-handler.ts Outdated
proxyName: instance.name,
tool: toolInfo.name,
args,
args: userVisibleArgs,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Keep it simple, use args directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Understood. I am holding branch changes until the original Slack requester (slack:U05QSJ4U0PM) confirms the review direction; if they do, I can revisit this and keep the path simpler.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. I simplified this path by dropping the temporary userVisibleArgs state and only stripping cloudId inline for the approval payload.


AI-generated — verify before acting. View Thor context

Comment thread docker-compose.yml Outdated
- DAYTONA_API_KEY=${DAYTONA_API_KEY:-}
- DAYTONA_API_URL=${DAYTONA_API_URL:-https://app.daytona.io/api}
- DAYTONA_SNAPSHOT=${DAYTONA_SNAPSHOT:-}
- ATLASSIAN_CLOUD_ID=${ATLASSIAN_CLOUD_ID:-}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Atlassian env vars should be in .env.

Suggested change
- ATLASSIAN_CLOUD_ID=${ATLASSIAN_CLOUD_ID:-}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. I am waiting for confirmation from the original Slack requester (slack:U05QSJ4U0PM) before making follow-up branch changes; if confirmed, I can simplify the compose/env surfacing accordingly.


AI-generated — verify before acting. View Thor context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3c74984. I removed the extra docker-compose.yml env surfacing and left Atlassian env vars sourced from .env / workflow env generation.


AI-generated — verify before acting. View Thor context

i-am-thor Bot and others added 4 commits June 4, 2026 13:05
Co-authored-by: Son Dao <son.dao@katalon.com>
Align the Atlassian proxy with the langfuse/grafana bundle pattern:
ATLASSIAN_AUTH + ATLASSIAN_CLOUD_ID now resolve all-or-nothing per scope.
A partial profile bundle is rejected instead of mixing scoped auth with
the global cloud ID, and an incomplete global config disables the proxy
(returns undefined) rather than throwing.

Also consolidate the bundle / profile-suffix docs into a single source of
truth in docs/feat/profile.md, trimming the repeated per-row suffix clause
from the README env table and the duplicated mitmproxy egress note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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