Skip to content

fix: align BTCPay manifest dependency with effective compatibility#177

Merged
rockstardev merged 2 commits intomasterfrom
feat/btcpay-compatibility
Mar 23, 2026
Merged

fix: align BTCPay manifest dependency with effective compatibility#177
rockstardev merged 2 commits intomasterfrom
feat/btcpay-compatibility

Conversation

@thgO-O
Copy link
Collaborator

@thgO-O thgO-O commented Mar 23, 2026

Description

This PR makes the Plugin Builder API return BTCPayServer manifest dependencies that match the effective compatibility stored in published versions.

It keeps the public catalog, update checks, and BTCPay Manage Plugins dependency rendering consistent when BTCPay min/max compatibility is overridden.

Screenshot 2026-03-23 at 14 58 12

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_resolve_threads'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 257894ce-ac38-4670-882b-9e22807b4eeb

📥 Commits

Reviewing files that changed from the base of the PR and between 1818a94 and c64fd64.

📒 Files selected for processing (1)
  • PluginBuilder/Controllers/ApiController.cs

Walkthrough

ApiController.CreatePublishedVersion now uses a cloned "effective" manifest produced by ApplyEffectiveBtcPayCompatibility when assigning PublishedVersion.ManifestInfo. The helper deep-clones the manifest and ensures a Dependencies entry for Identifier "BTCPayServer" is present, updated with a computed Condition string (">= min" and optionally "<= max"), or removed when constraints represent an unrestricted range. Tests in PluginBuilder.Tests add an assertion that reads PublishedVersion.ManifestInfo["Dependencies"], finds the BTCPayServer dependency, and verifies its Condition matches the expected BTCPay version range. A using System.Linq; import was added to support dependency selection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rockstardev
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: aligning BTCPay manifest dependencies with effective compatibility constraints.
Description check ✅ Passed The description is directly related to the changeset, explaining how the PR ensures BTCPayServer manifest dependencies match effective compatibility stored in published versions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/btcpay-compatibility

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@PluginBuilder/Controllers/ApiController.cs`:
- Around line 567-572: The current check uses
SequenceEqual(PluginVersion.Zero.VersionParts) which only matches a full-length
[0,0,0,0]; change the isUnrestricted logic to treat any-min-version that is all
zeros (regardless of length) as unrestricted by replacing the SequenceEqual
check with a test that ensures every element in btcpayMinVersion is zero (e.g.,
btcpayMinVersion.All(v => v == 0)); keep the btcpayMaxVersion null check and the
existing behavior of calling btcpayDependency?.Remove() and returning clone when
unrestricted; add a regression test that supplies short zero overrides like [0]
or [0,0] to ensure the dependency is removed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 427eebfa-fa84-4936-a00a-2f509546bb45

📥 Commits

Reviewing files that changed from the base of the PR and between d3b7f16 and 1818a94.

📒 Files selected for processing (2)
  • PluginBuilder.Tests/BTCPayCompatibilityTests.cs
  • PluginBuilder/Controllers/ApiController.cs

@thgO-O thgO-O requested a review from rockstardev March 23, 2026 19:48
Copy link
Member

@rockstardev rockstardev left a comment

Choose a reason for hiding this comment

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

You keep rocking with the PRs, keep it up

@rockstardev rockstardev merged commit e8216a6 into master Mar 23, 2026
2 of 3 checks passed
@thgO-O thgO-O deleted the feat/btcpay-compatibility branch March 23, 2026 23:12
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