Skip to content

Commit 0fba8c3

Browse files
committed
feature #159 Reduce the time before the first ping (Nyholm)
This PR was squashed before being merged into the master branch. Discussion ---------- Reduce the time before the first ping We've tried 12 months. From what I've seen there have only been positive responses. A bunch of issues have been closed but nobody was upset. People also understood that they should make a comment to show that the issue is still relevant and maintainer have added the "Keep open" label on some issues. Even I have been notified about issues I've forgotten. =) The original request for this feature suggested 3 months before the first ping, we decided to try out this feature on super old issues first. I think the try out period has proven to be successful. Commits ------- 15085de Update src/Command/PingStaleIssuesCommand.php 8b93068 Fixed psalm a8739d2 Update time interval d1e70c2 Reduce the time before the first ping
2 parents e19b909 + 15085de commit 0fba8c3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.symfony.cloud.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ crons:
4444

4545
stale_issues_symfony:
4646
spec: '58 12 * * *'
47-
cmd: croncape bin/console app:issue:ping-stale symfony/symfony
47+
cmd: croncape bin/console app:issue:ping-stale symfony/symfony --not-updated-for 6months
4848

4949
stale_issues_docs:
5050
spec: '48 12 * * *'
51-
cmd: croncape bin/console app:issue:ping-stale symfony/symfony-docs
51+
cmd: croncape bin/console app:issue:ping-stale symfony/symfony-docs --not-updated-for 12months
5252

5353
relationships:
5454
database: "mydatabase:postgresql"

src/Command/PingStaleIssuesCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
class PingStaleIssuesCommand extends Command
2424
{
25-
public const STALE_IF_NOT_UPDATED_SINCE = '-12months';
2625
public const MESSAGE_TWO_AFTER = '+2weeks';
2726
public const MESSAGE_THREE_AND_CLOSE_AFTER = '+2weeks';
2827

@@ -47,6 +46,7 @@ public function __construct(RepositoryProvider $repositoryProvider, IssueApi $is
4746
protected function configure()
4847
{
4948
$this->addArgument('repository', InputArgument::REQUIRED, 'The full name to the repository, eg symfony/symfony-docs');
49+
$this->addOption('not-updated-for', null, InputOption::VALUE_REQUIRED, 'A string representing a time period to for how long the issue has been stalled.', '12months');
5050
$this->addOption('dry-run', null, InputOption::VALUE_NONE, 'Do a test search without making any comments or changes');
5151
}
5252

@@ -61,7 +61,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
6161
return 1;
6262
}
6363

64-
$notUpdatedAfter = new \DateTimeImmutable(self::STALE_IF_NOT_UPDATED_SINCE);
64+
/** @var string $timeString */
65+
$timeString = $input->getOption('not-updated-for');
66+
$notUpdatedAfter = new \DateTimeImmutable('-'.ltrim($timeString, '-'));
6567
$issues = $this->issueApi->findStaleIssues($repository, $notUpdatedAfter);
6668

6769
if ($input->getOption('dry-run')) {

0 commit comments

Comments
 (0)