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

Fix validate sub-command after normalizer failure #352

Closed
wants to merge 5 commits into from
Closed

Fix validate sub-command after normalizer failure #352

wants to merge 5 commits into from

Conversation

guilliamxavier
Copy link

This PR

Related to #349 (part of; doesn't address the question of relaxing validation in the normalizer).
Related to #25.

to work around Composer bug(s) in combination with --no-check-lock/--no-check-publish
@guilliamxavier
Copy link
Author

guilliamxavier commented Feb 17, 2020

Note: The order of commits isn't completely logical. Here's a better recap (omitting static analysis noise):

  1. Add a new assertion (in existing test) that "The property name is required" is present in the error output => fails.
  2. Remove the --strict option from the call to composer validate => the new assertion now passes (and will keep passing for all the below), but the existing assertion that the exit code is 1 now fails because it is now 0.
  3. Remove the --no-check-publish option from the call to composer validate => publish errors are now displayed as errors (rather than mixed with warnings), but the exit-code assertion still fails, though differently: it is now 2.
  4. Replace return $this->validateComposerFile(/*...*/); with $this->validateComposerFile(/*...*/); return 1; => unexpectedly, the exit-code assertion still fails as "expected 1, actual 2".
  5. Disable auto-exit for running sub-commands => the exit-code assertion now passes (all tests pass).

Do you want me to reorder and force-push?

Update: done (see below)

@localheinz localheinz self-requested a review March 11, 2020 21:42
@localheinz localheinz self-assigned this Mar 11, 2020
@guilliamxavier guilliamxavier marked this pull request as draft April 14, 2020 12:34
@codecov
Copy link

codecov bot commented Apr 14, 2020

Codecov Report

Merging #352 into master will decrease coverage by 0.93%.
The diff coverage is 78.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #352      +/-   ##
============================================
- Coverage     87.43%   86.50%   -0.94%     
- Complexity       38       40       +2     
============================================
  Files             4        4              
  Lines           191      200       +9     
============================================
+ Hits            167      173       +6     
- Misses           24       27       +3     
Impacted Files Coverage Δ Complexity Δ
src/Command/NormalizeCommand.php 90.60% <78.57%> (-1.26%) 35.00 <2.00> (+2.00) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f64d3ac...014bb84. Read the comment docs.

Currently "publish errors" *are* schema violations (missing required properties or unknown additional properties)
(even in the case where composer validate would return 0 or 2)
@guilliamxavier guilliamxavier marked this pull request as ready for review April 14, 2020 13:50
@guilliamxavier
Copy link
Author

Heads-up: I went ahead and reordered the commits as proposed (and squashed static analysis noise into the corresponding commit). But now some checks are failing:

@localheinz
Copy link
Member

@guilliamxavier

Apologies again for the delay - I've started work on this, as I have had a few ideas around it!

I'll keep you posted!

🤓

@localheinz
Copy link
Member

@guilliamxavier

Thank you for your contribution, but I have taken a different approach in #416.

@localheinz localheinz closed this Apr 30, 2020
@guilliamxavier guilliamxavier deleted the patch-2 branch May 2, 2020 08:45
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