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

Bug fix: don't error out on out-of-sync lock file #213

Merged
merged 1 commit into from
Dec 28, 2021

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 28, 2021

Description

As far as I can see, the --no-check-lock argument has been available since Composer 1.0, so adding this argument to the composer validate command should be safe and should prevent the issues as reported in #206.

Includes tests (though the test isn't running properly yet).

Motivation and context

Fixes #206

How has this been tested?

I've tested this locally with the plain command with both Composer 1 and 2, but have not tested this in the context of this action.

I've added a unit test, but haven't managed to get it running properly.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.

tests/expect/composer_paths_08.exp Outdated Show resolved Hide resolved
@ramsey
Copy link
Owner

ramsey commented Dec 28, 2021

Aside from the typo causing problems in the test, this looks great to me. I think this is the right approach. Thanks!

@jrfnl jrfnl force-pushed the feature/206-composer-validate-bug-fix branch 2 times, most recently from bd63e59 to cbea958 Compare December 28, 2021 15:55
@ramsey
Copy link
Owner

ramsey commented Dec 28, 2021

I wonder if that's because it needs the executable bit. Do you have a way of setting chmod +x on that file and committing that change?

As far as I can see, the `--no-check-lock` argument has been available since Composer 1.0, so adding this argument to the `composer validate` command should be safe and should prevent the issues as reported in 206.

Includes tests (though the test isn't running properly yet).

Fixes 206
@jrfnl jrfnl force-pushed the feature/206-composer-validate-bug-fix branch from cbea958 to bf53470 Compare December 28, 2021 18:27
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 28, 2021

I wonder if that's because it needs the executable bit. Do you have a way of setting chmod +x on that file and committing that change?

Ha! Yes. That was it! Might be useful to add that information to the CONTRIBUTINGfile.

If it helps, even though file permissions are not handle the same on Windows, the git ls-files -s command to check the status works and will show the correct chmod status. The permissions for a file can be changed on Windows by running this command: git update-index --chmod=+x <file>.

I've updated the PR and have verified the new test fails without the fix and passes with the fix in place, so should be good to go now.

Thanks @ramsey for coaching me through this one.

@jrfnl jrfnl marked this pull request as ready for review December 28, 2021 18:28
@codecov
Copy link

codecov bot commented Dec 28, 2021

Codecov Report

Merging #213 (bf53470) into v2 (6e86502) will decrease coverage by 0.70%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v2     #213      +/-   ##
==========================================
- Coverage   88.70%   88.00%   -0.71%     
==========================================
  Files           5        5              
  Lines         124      125       +1     
==========================================
  Hits          110      110              
- Misses         14       15       +1     
Impacted Files Coverage Δ
bin/composer_paths.sh 87.80% <0.00%> (-2.20%) ⬇️

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 28, 2021

Hmm.. curious that Codecov doesn't pick up on the new unit test...

@ramsey
Copy link
Owner

ramsey commented Dec 28, 2021

Hmm.. curious that Codecov doesn't pick up on the new unit test...

I'm still learning how the Bash code coverage tooling works. 🤷🏻‍♂️

@ramsey
Copy link
Owner

ramsey commented Dec 28, 2021

I have a suspicion that multi-line commands in Bash (like this one) aren't being correctly reported.

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 28, 2021

That might well explain it, though the second line of the command is recognized as covered (correctly).

[Edit]: on second look, no doesn't seem to be recognized either, so yeah, you're right. Multi-line commands seem to be the issue.

@ramsey ramsey merged commit 713bde7 into ramsey:v2 Dec 28, 2021
@jrfnl jrfnl deleted the feature/206-composer-validate-bug-fix branch December 28, 2021 18:42
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.

Action erroring out on with incorrect invalid composer.json report
2 participants