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

Remove conflict definition #53

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Remove conflict definition #53

merged 2 commits into from
Apr 9, 2024

Conversation

Propaganistas
Copy link
Contributor

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.13%. Comparing base (9eeccc6) to head (d4f920c).
Report is 15 commits behind head on main.

❗ Current head d4f920c differs from pull request most recent head 447869c. Consider uploading reports for the commit 447869c to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #53      +/-   ##
============================================
+ Coverage     94.09%   94.13%   +0.04%     
- Complexity      987      990       +3     
============================================
  Files            13       14       +1     
  Lines          2423     2559     +136     
============================================
+ Hits           2280     2409     +129     
- Misses          143      150       +7     

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

@Propaganistas
Copy link
Contributor Author

@giggsey Not sure why the PHPStan workflow is failing during checkout. You might want to rerun the job manually.

@Propaganistas
Copy link
Contributor Author

Propaganistas commented Apr 9, 2024

I think you should remove the following lines from the SAST workflow. It makes PRs from forks fail.

with:
ref: ${{ github.head_ref }}

@giggsey
Copy link
Owner

giggsey commented Apr 9, 2024

I think you should remove the following lines from the SAST workflow. It makes PRs from forks fail.

with:
ref: ${{ github.head_ref }}

Can you remove that uses section? I don't have permission to push to your branch

auto-merge was automatically disabled April 9, 2024 12:00

Head branch was pushed to by a user without write access

@Propaganistas
Copy link
Contributor Author

done, but i'm unsure which workflow will be run. I would assume that the original repo's workflow will be run to avoid security issues.

@giggsey
Copy link
Owner

giggsey commented Apr 9, 2024

Thanks, that's fine. If it fails again, I'll force merge.

@giggsey giggsey enabled auto-merge April 9, 2024 12:05
@giggsey giggsey merged commit 8daadbd into giggsey:main Apr 9, 2024
10 checks passed
@Propaganistas Propaganistas deleted the patch-1 branch April 9, 2024 13:10
@Propaganistas
Copy link
Contributor Author

Propaganistas commented Apr 10, 2024

@giggsey Sorry to revisit this. Last night I was thinking it might be better to set the conflict configuration to the following:

"conflict": {
   "giggsey/libphonenumber-for-php": "<8.13.35"
}
  • Whenever lite gets installed with a version <= 8.13.34, the conflict config is still there, so it'll conflict with any main package's version. We can't really help that situation (conflict takes precedence) besides forcing the dev to update lite.
  • As soon as lite gets installed starting from the new version (8.13.35 - to be released):
    • Starting from main package version 8.13.35 (to be released), the replace config is in place so everything will work as expected
    • if main package's version is <= 8.13.34, there's no replace config in those old versions. But lite will gladly install because the conflict config is now gone.... causing namespace overlap. The conflict version constraint above would gracefully handle this.

It's really a brain dump. I'd advise to test this behavior locally first.

giggsey added a commit that referenced this pull request Apr 10, 2024
Any giggsey/libphonenumber-for-php version above 8.13.35 will replace giggsey/libphonenumber-for-php-lite. But older versions won't, so we need to implicitly conflict with them.

See #53
@giggsey
Copy link
Owner

giggsey commented Apr 10, 2024

I've 'successfully' installed this together, which proves your problem:

{
    "require": {
        "giggsey/libphonenumber-for-php-lite": "dev-main as 8.13.35",
        "giggsey/libphonenumber-for-php": "^8.13"
    }
}

With #54, dev-conflict for lite gives a composer error.

Replacing the composer.json with:

{
    "require": {
        "giggsey/libphonenumber-for-php-lite": "dev-conflict as 8.13.35",
        "giggsey/libphonenumber-for-php": "dev-master as 8.13.35"
    }
}

still errors:

  • Root composer.json requires giggsey/libphonenumber-for-php-lite dev-conflict as 8.13.35 -> satisfiable by giggsey/libphonenumber-for-php-lite[dev-conflict].
  • Only one of these can be installed: giggsey/libphonenumber-for-php[dev-master], giggsey/libphonenumber-for-php-lite[dev-conflict]. giggsey/libphonenumber-for-php replaces giggsey/libphonenumber-for-php-lite and thus cannot coexist with it.
  • Root composer.json requires giggsey/libphonenumber-for-php dev-master as 8.13.35 -> satisfiable by giggsey/libphonenumber-for-php[dev-master].

I'll try to read the composer docs over the next few days.

@Propaganistas
Copy link
Contributor Author

Propaganistas commented Apr 14, 2024

@giggsey

I did some more investigation. It appears that replace takes precedence over conflict - sorry for the confusion earlier.
In that regard, the replace config was the most essential part and the missing link. The conflict configuration is quite crucial as well (see tables below), but I think it doesn't matter how it gets configured (* or <8.13.35). As long as it's there in some way so it'll error out for older versions of the main package. So I guess it can be set to whatever you feel most comfortable with...

Sorry for the misdirecting OP/PR. I've learned about composer internals myself now!

main lite result
< 8.13.35 without conflict double install - NOK
>= 8.13.35 without conflict replace kicks in - single install of main - OK
main lite result
< 8.13.35 with conflict conflict error - OK
>= 8.13.35 with conflict replace kicks in - single install of main - OK

@giggsey
Copy link
Owner

giggsey commented Apr 16, 2024

Just so i'm clear, we need to add the conflict back (#54) to lite? The replace in main is needed, and remains.

If so, it's probably safer to keep lite's conflict as *

@Propaganistas
Copy link
Contributor Author

Just so i'm clear, we need to add the conflict back (#54) to lite?

Correct. Sorry for the hassle

@giggsey
Copy link
Owner

giggsey commented Apr 16, 2024

Thanks @Propaganistas - I'll change it to * in case of version number weirdness

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