Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip-changelog] Check if a dependency matches the constraint when --no-overwrite flag is set #2331

Closed

Conversation

MatteoPologruto
Copy link
Contributor

@MatteoPologruto MatteoPologruto commented Sep 20, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Code imperfection fix

What is the current behavior?

Installing a library with --no-overwrite fails if one of its dependency is already installed but outdated, even if it stills matches the version constraint.

What is the new behavior?

Installing a library with --no-overwrite does not try to upgrade the library's dependencies if their version matches the constraint, preventing the installation from failing.

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

@MatteoPologruto MatteoPologruto added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 20, 2023
@MatteoPologruto MatteoPologruto self-assigned this Sep 20, 2023
@MatteoPologruto MatteoPologruto marked this pull request as ready for review September 20, 2023 15:57
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch coverage: 86.36% and project coverage change: +0.08% 🎉

Comparison is base (0e6133f) 63.03% compared to head (43248d4) 63.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2331      +/-   ##
==========================================
+ Coverage   63.03%   63.11%   +0.08%     
==========================================
  Files         201      201              
  Lines       19264    19284      +20     
==========================================
+ Hits        12143    12172      +29     
+ Misses       6067     6060       -7     
+ Partials     1054     1052       -2     
Flag Coverage Δ
unit 63.11% <86.36%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
commands/lib/install.go 70.90% <66.66%> (-0.38%) ⬇️
commands/lib/resolve_deps.go 88.23% <100.00%> (+3.23%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 132 to 137
string version_required = 2;
// Version of the library dependency currently installed.
string version_installed = 3;
// Version constraint of the dependency.
string version_constraint = 4;
}
Copy link
Member

Choose a reason for hiding this comment

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

version_constraint seems redundant here, why do we need a version_constraint if we already have a version_required?

I mean if we have, say:

version_required: 1.2.3
version_contraint: >=1.2.0 && <2.0.0

version 1.2.3 is already the solution and matches the version_constraint.

@umbynos umbynos added this to the Arduino CLI v0.35.0 milestone Oct 2, 2023
@umbynos umbynos removed this from the Arduino CLI v0.35.0 milestone Oct 12, 2023
@cmaglie
Copy link
Member

cmaglie commented Nov 29, 2023

Superseded by #2431

@cmaglie cmaglie closed this Nov 29, 2023
@per1234 per1234 added the conclusion: duplicate Has already been submitted label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
4 participants