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

Overhaul tool usage in CI and for contribution #591

Merged
merged 11 commits into from Feb 18, 2024

Conversation

mk-mxp
Copy link
Contributor

@mk-mxp mk-mxp commented Dec 6, 2023

  • Put all code styling rules into PHPCS config
    • Add XML namespace for completeness
    • Remove non-existent type="int"
    • Add directory rules for improved test coverage and required exceptions
    • Fix the new upcoming violations
  • PHPCS config renamed to default name
  • Moved tool installation to composer
  • Moved tool usage to composer
    • Allows running all unit tests now, too
  • Overhauled README

This is part of the discussion in the forum.

neenjaw
neenjaw previously requested changes Dec 6, 2023
Copy link
Collaborator

@neenjaw neenjaw left a comment

Choose a reason for hiding this comment

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

Couple small changes needed. I'm fine with putting it in one place.

exercises/concept/city-office/.meta/exemplar/Form.php Outdated Show resolved Hide resolved
exercises/concept/windowing-system/.meta/exemplar.php Outdated Show resolved Hide resolved
@mk-mxp
Copy link
Contributor Author

mk-mxp commented Dec 6, 2023

Should I do these also?

@mk-mxp mk-mxp requested a review from neenjaw December 6, 2023 17:29
@mk-mxp mk-mxp changed the title Put all code styling rules into PHPCS config Overhaul tool usage in CI and for contribution Dec 7, 2023
@mk-mxp
Copy link
Contributor Author

mk-mxp commented Dec 7, 2023

@neenjaw Please take a look now. I may split this into separate PRs, also.

@mk-mxp
Copy link
Contributor Author

mk-mxp commented Dec 9, 2023

@neenjaw I think, GitHub is confused because I'm not assigned to this PR and so my changes do not count for review resolving.

@mk-mxp
Copy link
Contributor Author

mk-mxp commented Dec 27, 2023

@neenjaw The latest version of PHP CodeSniffer is not compatible to the latest Slevomat Coding Standard. I did exclude the updated PHP CodeSniffer for installation, but that is of course only temporary.

@mk-mxp
Copy link
Contributor Author

mk-mxp commented Dec 27, 2023

Problem:

"Invalid sniff properties set for individual sniffs will now result in an error and halt the execution of PHPCS"
PHPCodeSniffer Release notes V3.8.0

Solution:

  • Change Slevomat Sniff property to current name

@neenjaw
Copy link
Collaborator

neenjaw commented Dec 27, 2023

Can you cherry pick a patch to fix ci to a separate pr to unblock the other prs?

I haven't had time to review this one as it comprises a more complex change for the track.

@mk-mxp
Copy link
Contributor Author

mk-mxp commented Dec 28, 2023

Rebased to solve merge conflicts.

Might it help to split this PR into 2 or 3? One with the rules / changes due to rules, one with the README and contribution workflow changes and maybe the removal of the old scripts also in one extra?

What I checked for workflow changes / script removal:

  • This projects CI does not use the removed scripts. It uses composer for PHP CodeSniffer and direct PHAR download for PHPUnit
  • PHP test runner does it's own thing
  • PHP representer also has nothing to do with these workflow files
  • I haven't found any hint on CI workflows other than configlet stuff in Exercism's documentation
  • We use composer during contribution workflow (locally and in CI) only, with no potential for package version conflicts because of the nature of the exercises
  • composer is the only tool used for contribution now, running the exact same things in CI and locally (if locally up-to-date, of course)

@mk-mxp mk-mxp mentioned this pull request Jan 30, 2024
6 tasks
@mk-mxp mk-mxp self-assigned this Feb 16, 2024
@mk-mxp mk-mxp added x:action/improve Improve existing functionality/content x:knowledge/intermediate Quite a bit of Exercism knowledge required x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises) x:size/small Small amount of work x:rep/small Small amount of reputation labels Feb 16, 2024
@mk-mxp
Copy link
Contributor Author

mk-mxp commented Feb 16, 2024

@ErikSchierboom Please advise on the following:

This MR changes the contribution workflow for the PHP track massively. One part is removing install.sh and install-* completely. They are not used in CI since long and now replaced by composer install for contributors.

Does this have any negative impact on you or other parts of exercism (e.g. mass MRs)?

Copy link
Contributor

@homersimpsons homersimpsons left a comment

Choose a reason for hiding this comment

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

Let's get this merged, I did suggest some re-wording, feel free to discuss them.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
phpcs.xml Outdated Show resolved Hide resolved
@mk-mxp mk-mxp mentioned this pull request Feb 18, 2024
25 tasks
- Add XML namespace for completeness
- Remove non-existent `type="int"`
- Add directory rules for improved test coverage and required
  exceptions
- Fix the new upcoming violations
- Revert adding visibility
- Exclude those exercises from PHPCS rule
For testing CI test file coverage, print verbose output
This is actually present everywhere in the code base, but not explicitly covered by the rules.
The file names are set in `.meta/config.json`. And some exercises have
more than one file as example solution.
@mk-mxp mk-mxp removed the request for review from neenjaw February 18, 2024 18:23
@mk-mxp mk-mxp dismissed neenjaw’s stale review February 18, 2024 18:41

Reviewer has no time to follow up

@homersimpsons homersimpsons merged commit d3a686c into exercism:main Feb 18, 2024
12 checks passed
@homersimpsons
Copy link
Contributor

Congratulations @mk-mxp let's continue !

@mk-mxp mk-mxp deleted the phpcs-config-optimisation branch February 19, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/improve Improve existing functionality/content x:knowledge/intermediate Quite a bit of Exercism knowledge required x:rep/small Small amount of reputation x:size/small Small amount of work x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants