Skip to content

CLI-447 Use the declarative framework for migrations#335

Merged
damien-urruty-sonarsource merged 2 commits into
masterfrom
feature/dam/CLI-447-declarative-migrations
Jun 1, 2026
Merged

CLI-447 Use the declarative framework for migrations#335
damien-urruty-sonarsource merged 2 commits into
masterfrom
feature/dam/CLI-447-declarative-migrations

Conversation

@damien-urruty-sonarsource
Copy link
Copy Markdown
Contributor

@damien-urruty-sonarsource damien-urruty-sonarsource commented May 28, 2026


Summary by Gitar

  • New declarative framework:
    • Introduced IntegrationRegistry core logic to centrally manage and validate integration declarations.
    • Added ALL_INTEGRATIONS entry point for automated registration of existing integrations.
  • Migration logic:
    • Added migrateDeclarativeIntegrations to post-update.ts to automatically reapply features and prune stale states after CLI upgrades.
    • Integrated migrateClaudeCodeHooks with the new framework to skip legacy migration when declarative tracking is present.
  • Testing enhancements:
    • Added comprehensive unit tests for registry validation and integration seeding.
    • Added integration tests to verify that declarative Claude hooks are refreshed correctly during CLI upgrades.

This will update automatically on new commits.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 28, 2026

Agentic Analysis: Early Results

Agentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action.

1 issue(s) found across 1 file(s):

Rule File Line Message
typescript:S3776 src/lib/post-update.ts 370 Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.

Analyzed by SonarQube Agentic Analysis in 7.6 s

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented May 28, 2026

CLI-447

Comment thread src/lib/post-update.ts Outdated
Comment thread src/cli/commands/integrate/claude/declaration.ts Outdated
Comment thread src/lib/post-update.ts Outdated
Comment thread tests/unit/cli/commands/self-update/post-update.test.ts
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.

LGTM! Added a few questions/comments

@damien-urruty-sonarsource damien-urruty-sonarsource force-pushed the feature/dam/CLI-447-declarative-migrations branch from 6b2ed54 to c84ff7a Compare June 1, 2026 12:15
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@damien-urruty-sonarsource damien-urruty-sonarsource merged commit c6064ba into master Jun 1, 2026
16 checks passed
@damien-urruty-sonarsource damien-urruty-sonarsource deleted the feature/dam/CLI-447-declarative-migrations branch June 1, 2026 12:27
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 1, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Refactors the CLI to use a declarative migration framework managed by IntegrationRegistry, addressing redundant null checks and simplifying state pruning during upgrades.

✅ 1 resolved
Quality: Redundant null check on feature after filtering by same map

📄 src/lib/post-update.ts:120-124
At line 121-123 of post-update.ts, featuresById.get(installedFeature.featureId) is checked for undefined, but knownFeatures (line 111-113) was already filtered to only include features whose featureId exists in featuresById. The guard is dead code. While harmless, it adds unnecessary noise.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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