-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Improve setup-ci command with helper links and allow override #3438
Conversation
2a6f047
to
19cc207
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 praise: It's a great addition
|
||
$workflowTemplate = FileSystem::read(__DIR__ . '/../../../templates/rector-github-action-check.yaml'); | ||
$workflowTemplate = FileSystem::read(__DIR__ . '/../../../templates/rector-github-action-check.yaml'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 suggestion: I usually prefer this notation for readability
$workflowTemplate = FileSystem::read(__DIR__ . '/../../../templates/rector-github-action-check.yaml'); | |
$workflowTemplate = FileSystem::read(dirname(__DIR__, 3) . '/templates/rector-github-action-check.yaml'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually shuts the PHPStan check for missing file.
Also is dynamic over static value.
$this->symfonyStyle->writeln( | ||
'1) Generate new Github Token here:' . | ||
PHP_EOL . | ||
'https://github.com/settings/tokens/new' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 suggestion: I would add a clickable link, in order to simplify usage
$this->symfonyStyle->writeln( | |
'1) Generate new Github Token here:' . | |
PHP_EOL . | |
'https://github.com/settings/tokens/new' | |
); | |
$this->symfonyStyle->writeln( | |
'1) Generate new Github Token here:' . | |
PHP_EOL . | |
'<href=https://github.com/settings/tokens/new>https://github.com/settings/tokens/new</>' | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3457 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3457 :)
$this->symfonyStyle->writeln( | ||
'2) Add it to your repository secrets under "GITHUB_TOKE" name:' | ||
. PHP_EOL . | ||
sprintf('https://github.com/%s/settings/secrets/actions/new', $currentRepository) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 suggestion: Here too, I would add a clickable link, in order to simplify usage
$this->symfonyStyle->writeln( | |
'2) Add it to your repository secrets under "GITHUB_TOKE" name:' | |
. PHP_EOL . | |
sprintf('https://github.com/%s/settings/secrets/actions/new', $currentRepository) | |
); | |
$this->symfonyStyle->writeln( | |
'2) Add it to your repository secrets under "GITHUB_TOKE" name:' | |
. PHP_EOL . | |
sprintf('<href=https://github.com/%s/settings/secrets/actions/new>https://github.com/%s/settings/secrets/actions/new</>', $currentRepository) | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. How does this look in the Symfony style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on your shell, usually it prints the link bolder or sharper, and underlined.
See https://symfony.com/blog/new-in-symfony-4-3-console-hyperlinks
sprintf('https://github.com/%s/settings/secrets/actions/new', $currentRepository) | ||
); | ||
|
||
$this->symfonyStyle->newLine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: If it is possible to add some links to a documentation page:
- Fine grained Organization access token: https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization
- Fine grained user access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Most people don't read these, so we have limit for 2 links maximum. This command should help people just dump it and use it.
Which 2 links would you go for having typical Rector developer in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best would be an info message at the end, telling "If you want to get deeper and configure actions for a whole organization, please see [...]" with the link to the organization access token configuration.
@gplanchat Thanks for quick testing and feedback 👍 This will allow people to use Rector in CI on massive level 👏 |
No description provided.