Skip to content

[APPS][Connections Part 1] Add backend connection manifest upload plumbing#338

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
sdkennedy2/apps-connection-id-manifest-upload
May 6, 2026
Merged

[APPS][Connections Part 1] Add backend connection manifest upload plumbing#338
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
sdkennedy2/apps-connection-id-manifest-upload

Conversation

@sdkennedy2
Copy link
Copy Markdown
Collaborator

@sdkennedy2 sdkennedy2 commented May 6, 2026

Motivation

Backend Functions that use connections need to provide a static list of allowed connection ids. When the backend function executes only connections defined within this list can be used as part of an action defined within the backend function.

In the following example: 'c1ef81d2-78e6-4e4c-bf30-9c04f448d0a2' would need to be defined in the allowed connection ids for listHosts.

import { listHosts as listHostsAction, type ListHostsResponse } from '@datadog/action-catalog/dd/hosts';

export async function listHosts(filter?: string): Promise<ListHostsResponse> {
    const response = await listHostsAction({
        inputs: {
            filter: filter ?? '*',
            count: 10,
            include_hosts_metadata: true,
        },
        connectionId: 'c1ef81d2-78e6-4e4c-bf30-9c04f448d0a2'
    });

    return response;
}

The allowed connection ids needs to be submitted to the backend during app upload as part of the manifest.json file (more details in the RFC here).

For this example the expected manifest.json would look like the following:

{
  "backend": {
    "functions": {
      "YzFlZjgxZDItNzhlNi00ZTRjLWJmMzAtOWMwNGY0NDhkMGEy.listHosts": {
        "allowedConnectionIds": ['c1ef81d2-78e6-4e4c-bf30-9c04f448d0a2']
      }
    }
  }
}

Changes

Adds the plumbing necessary to submit allowedConnectionIds as part of the manifest.json and when testing backend functions as part of the dev server.

Initially allowedConnectionIds will always be empty. Connection ID extraction is intentionally deferred to follow-up PRs in this stack.

QA Instructions

E2E and unit tests added. We can run those.

Blast Radius

This affects the apps Vite plugin backend function transform, upload archive assembly, and dev-preview execution payloads. The first PR emits empty allowlists only, so it establishes structure without enabling connection-using actions.

Documentation

Copy link
Copy Markdown
Collaborator Author

sdkennedy2 commented May 6, 2026

@sdkennedy2 sdkennedy2 changed the title [APPS] Add backend connection manifest upload plumbing [APPS][Part 1 of 4] Add backend connection manifest upload plumbing May 6, 2026
@sdkennedy2
Copy link
Copy Markdown
Collaborator Author

@codex review
@cursor review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented May 6, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8aeb377 | Docs | Datadog PR Page | Give us feedback!

@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch from 9a1dbe0 to 04d954f Compare May 6, 2026 00:47
@sdkennedy2
Copy link
Copy Markdown
Collaborator Author

@codex review
@cursor review

@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch from 04d954f to d230cbd Compare May 6, 2026 00:54
@sdkennedy2
Copy link
Copy Markdown
Collaborator Author

@codex review
@cursor review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d230cbd1d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/plugins/apps/src/index.ts Outdated
allowedConnectionIds: [...func.allowedConnectionIds],
};
}
const manifest = { backend: { functions } };
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Upload the manifest even when no frontend assets exist

Because this manifest is created only after the earlier if (!assets.length) return guard, any build where collectAssets() finds no frontend files skips the new manifest entirely, and also skips any backend outputs passed into handleUpload. In a backend-only app or an empty frontend output directory, getBackendFunctions()/backendOutputs can still be non-empty, but no manifest.json connection allowlist is archived or uploaded. Move the no-assets decision until after backend bundles and the manifest have been appended, or base it on the final allAssets list.

Useful? React with 👍 / 👎.

@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch from d230cbd to a91c48b Compare May 6, 2026 13:35
@sdkennedy2
Copy link
Copy Markdown
Collaborator Author

@codex review
@cursor review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

relativePath: refPath,
name: exportName,
absolutePath: id,
allowedConnectionIds: [],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We will populate this value in a later PR.

@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch from a91c48b to 9ce0085 Compare May 6, 2026 13:45
@sdkennedy2 sdkennedy2 changed the title [APPS][Part 1 of 4] Add backend connection manifest upload plumbing [APPS][Connections Part 1] Add backend connection manifest upload plumbing May 6, 2026
@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch 2 times, most recently from b89f346 to 5c93fa8 Compare May 6, 2026 13:49
@sdkennedy2 sdkennedy2 marked this pull request as ready for review May 6, 2026 17:03
@sdkennedy2 sdkennedy2 requested a review from yoannmoinet as a code owner May 6, 2026 17:03
@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch 2 times, most recently from 2234d86 to 4769d38 Compare May 6, 2026 18:10
@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-hide-standalone-url branch from 3d1a731 to bed9e2f Compare May 6, 2026 18:10
Base automatically changed from sdkennedy2/apps-hide-standalone-url to master May 6, 2026 18:20
@sdkennedy2 sdkennedy2 force-pushed the sdkennedy2/apps-connection-id-manifest-upload branch from 4769d38 to 8aeb377 Compare May 6, 2026 18:28
Copy link
Copy Markdown
Member

@yoannmoinet yoannmoinet left a comment

Choose a reason for hiding this comment

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

LGTM

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit c692b4f into master May 6, 2026
6 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the sdkennedy2/apps-connection-id-manifest-upload branch May 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants