Skip to content

[CXP-637] fix capabilities workflow failing with missing --input flag#44

Merged
mateovespConductor merged 4 commits into
mainfrom
mateovesp/fix-capabilities-workflow
Jul 1, 2026
Merged

[CXP-637] fix capabilities workflow failing with missing --input flag#44
mateovespConductor merged 4 commits into
mainfrom
mateovesp/fix-capabilities-workflow

Conversation

@mateovespConductor

Copy link
Copy Markdown
Contributor

Description

  • Bug fix
  • New feature

Useful links:

@mateovespConductor mateovespConductor requested a review from a team June 30, 2026 15:37
@linear-code

linear-code Bot commented Jun 30, 2026

Copy link
Copy Markdown

CXP-637

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Connector PR Review: [CXP-637] fix capabilities workflow failing with missing --input flag

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 17259bb263c4.
Review mode: incremental since 5bf8b03
View review run

Review Summary

The full PR diff was scanned for security and correctness. The new commit only changes StaticCapabilitiesConnector.Metadata DisplayName from "Baton-File Connector" to "File Connector" (pkg/connector/connector.go:36), which now matches the existing FileConnector.Metadata display name, a safe non-breaking display-name change (B9). No new issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

@github-actions github-actions Bot left a comment

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.

No blocking issues found.

@github-actions github-actions Bot left a comment

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.

No blocking issues found.

Comment thread .github/workflows/capabilities.yaml Outdated

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.

could you generate capabilities from main? https://github.com/ConductorOne/baton-file/blob/main/cmd/baton-file/main.go#L28

if you remove this line from baton admin and add WithDefaultCapabilitiesConnectorBuilder you don't need this file anymore

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good call on the direction. One thing to flag though: passing &FileConnector{} directly won't work here — ResourceSyncers() tries to load the input file and returns nil syncers when it's empty, so you'd get capabilities with zero resource types. Since baton-file is data-driven, you'd need a small StaticCapabilitiesConnector that just iterates TraitMap without touching any file:

type StaticCapabilitiesConnector struct{}

func (s *StaticCapabilitiesConnector) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSyncerV2 {
    var syncers []connectorbuilder.ResourceSyncerV2
    for name, trait := range TraitMap {
        syncers = append(syncers, &resourceBuilder{resourceType: buildDynamicResourceType(name, trait.String())})
    }
    return syncers
}

Then in main.go: connectorrunner.WithDefaultCapabilitiesConnectorBuilder(&connector.StaticCapabilitiesConnector{}). With that, ./connector capabilities works with no --input and the whole fixture machinery in this workflow goes away. Worth doing in this PR or as a follow-up?

Comment thread .github/workflows/capabilities.yaml Outdated
./connector config > config_schema.json
# Assert all known traits appear in the output. If TraitMap grows, add the
# new trait to both the fixture above and this list.
for trait in TRAIT_USER TRAIT_GROUP TRAIT_ROLE TRAIT_APP TRAIT_SECRET; do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: this assertion loop lives inside the Run and save output step, so when a trait is missing CI shows Run and save output failed — not super helpful for diagnosing what's actually broken. Would be cleaner to pull the for loop into its own step:

- name: Verify trait coverage in capabilities output
  run: |
    for trait in TRAIT_USER TRAIT_GROUP TRAIT_ROLE TRAIT_APP TRAIT_SECRET; do
      grep -q "$trait" baton_capabilities.json || { echo "ERROR: $trait missing from baton_capabilities.json"; exit 1; }
    done

That said, if luisina's WithDefaultCapabilitiesConnectorBuilder approach gets implemented, this whole step goes away anyway — so might not be worth fixing here if that's coming soon.

@github-actions github-actions Bot left a comment

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.

No blocking issues found.

@FeliLucero1 FeliLucero1 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.

lgtm! the StaticCapabilitiesConnector approach is the right call — clean and no fixture needed.

two small nits inline:

  • display name inconsistency between StaticCapabilitiesConnector ("Baton-File Connector") and FileConnector ("File Connector") — probably worth aligning
  • baton_capabilities.json and config_schema.json are now committed with no workflow to regenerate them — is baton-admin running the binary directly and these files are just snapshots, or do they need a new update mechanism?

@github-actions github-actions Bot left a comment

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.

No blocking issues found.

@btipling btipling removed their assignment Jul 1, 2026
@mateovespConductor mateovespConductor merged commit 10e0ba3 into main Jul 1, 2026
9 checks passed
@mateovespConductor mateovespConductor deleted the mateovesp/fix-capabilities-workflow branch July 1, 2026 18:35
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.

4 participants