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

WIP: Add Gitlab issue printer for Gitlab CI and Code Quality Widget #4801

Draft
wants to merge 12 commits into
base: v5
Choose a base branch
from

Conversation

octoquad
Copy link

@octoquad octoquad commented Sep 15, 2023

This PR adds a new Gitlab issue printer for Gitlab.

This PR also adds some missing formats not listed in various files as well and fixes some docs.

  • Add Gitlab Issue Printer
  • Add necessary command flags
  • Add tests
  • Add example for a .gitlab-ci.yml

Closes #4800

Import Gitlab CI printer.
Registered new 'gitlab' output printer with printer factory.
Update --output-mode options:
- Added new Gitlab printer
- Added missing html printer
- Added missing verbose printer
- Re-ordered available printers alphabetically
Updated README with new Gitlab output format:
- Reordered list alphabetically
- Added missing HTML format
- Added missing verbose text format
- Added new Gitlab printer to --output-mode for ZSH
- Reordered output modes alphabetically, except for text and verbose
Update --output-mode to add new Gitlab mode.
Add Gitlab printer to known output-mode check:
- Removed redundent is_string() check
- Added missing html and verbose output modes
Added new gitlab option for bash completion.
Fixed incorrect path to PHPCS ruleset file.
Grant permission for dealerdirect/phpcodesniffer-composer-installer plugin to
install Slevomat coding standard.
- Added a new Gitlab Printer test based of JSON Printer Test.
- Remove location.lines.end in JSON output. Not used by Gitlab.
@rlerdorf
Copy link
Collaborator

Sorry for the delay, just looking at this now. Could you fix the failing test?

There was 1 failure:

1) Phan\Tests\CLITest::testInternalDocsUpdated
Expected internal/CLI-HELP.md to be updated with the contents of phan --extended-help
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
   `.phan/config.php`).
 
  -m, --output-mode <mode>
-  Output mode from 'checkstyle', 'codeclimate', 'csv', 'gitlab', 'html', 'json', 'pylint', 'text' (default) or 'verbose'
+  Output mode from 'text', 'verbose', 'json', 'csv', 'codeclimate', 'checkstyle', 'pylint', or 'html'
 
  -o, --output <filename>
   Output filename

Also, this fails phan itself:

src/Phan/Output/Printer/GitlabPrinter.php:25 PhanCompatibleTypedProperty Cannot use typed properties before php 7.4. This property group has type \Symfony\Component\Console\Output\OutputInterface
src/Phan/Output/Printer/GitlabPrinter.php:28 PhanCompatibleTypedProperty Cannot use typed properties before php 7.4. This property group has type array
src/Phan/Output/Printer/GitlabPrinter.php:58 PhanPluginPossiblyStaticPrivateMethod Private method \Phan\Output\Printer\GitlabPrinter::generateFingerprint() can be static
src/Phan/Output/Printer/GitlabPrinter.php:63 PhanPluginPossiblyStaticPrivateMethod Private method \Phan\Output\Printer\GitlabPrinter::getSeverityName() can be static
tests/Phan/Output/Printer/GitlabPrinterTest.php:27 PhanPluginDescriptionlessCommentOnPublicMethod Public method \Phan\Output\Printer\GitlabPrinterTest::testPrintOutput has no readable description: "* @covers \\Phan\\Output\\Printer\\GitlabPrinter\n* @covers \\Phan\\IssueInstance\n* @covers \\Phan\\Issue"

You can run ./test and phan in your rebased tree to see both of these.

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.

Implement Gitlab Issue Printer for CI
2 participants