Skip to content

Commit

Permalink
chore: disable stale workflow by default (projen#1689)
Browse files Browse the repository at this point in the history
After talking with others and reviewing its impact on contributors of different GitHub projects, it feels like enabling the stale workflow may not be the right default for all projects. This PR changes the default to not adding it, so it's now opt-in.

BREAKING CHANGE: `stale.yml` GitHub workflow is no longer generated as the default behavior in projects. To keep generating it, specify `stale: true` or initialize a `github.Stale` component directly.

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
Chriscbr authored Mar 17, 2022
1 parent edd0088 commit 06123c9
Show file tree
Hide file tree
Showing 26 changed files with 98 additions and 1,226 deletions.
1 change: 0 additions & 1 deletion .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions .github/workflows/stale.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 42 additions & 42 deletions docs/api/API.md

Large diffs are not rendered by default.

28 changes: 27 additions & 1 deletion docs/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,36 @@ By default, many projects are initialized with `GitHub` component to enabled Git

The use of GitHub (and generating corresponding files in `.github`) can be disabled by specifying `github: false` in your project options.

### Workflows
## Workflows

TODO

See the `GitHub`, `GithubWorkflow`, and `Job` types in the [API reference](./api/API.md) for currently available APIs.

Example code of creating a GitHub workflow: <https://github.com/projen/projen/blob/65b4194c163f47ba4842981b0c92dbe516be787b/src/github/auto-approve.ts#L67-L105>

### Stale workflow

A "stale" workflow can be added which will automatically close issues or pull
requests on your GitHub repository after time has passed without the issue
seeing any comments or updates. You can enable as shown below:

```ts
// or PythonProject, etc.
new typescript.TypeScriptProject({
stale: true,
staleOptions: {
issues: {
closeMessage: "closing pull request",
staleLabel: "I-AM-STALE",
daysBeforeStale: 180,
},
}
})
```

Check the API reference for a list of all available options.

When enabled, by default issues with no activity with will be marked as stale
after 60 days and closed within 7 days, and pull requests with no activity will
be marked as stale after 14 days and closed within 2 days.
4 changes: 2 additions & 2 deletions src/github/github-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export interface GitHubProjectOptions extends ProjectOptions {
/**
* Auto-close of stale issues and pull request. See `staleOptions` for options.
*
* @default true
* @default false
*/
readonly stale?: boolean;

Expand Down Expand Up @@ -218,7 +218,7 @@ export class GitHubProject extends Project {
);
}

const stale = options.stale ?? true;
const stale = options.stale ?? false;
if (stale && this.github) {
new Stale(this.github, options.staleOptions);
}
Expand Down
3 changes: 0 additions & 3 deletions test/__snapshots__/cleanup.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 0 additions & 136 deletions test/__snapshots__/integ.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 06123c9

Please sign in to comment.