Skip to content

Commit 7d8731d

Browse files
Add stale workflow to cleanup stale issues and PRs (#3747)
* Add stale workflow to cleanup stale issues and PRs * Update contributor docs * Update * Changes
1 parent 2fed073 commit 7d8731d

File tree

4 files changed

+301
-59
lines changed

4 files changed

+301
-59
lines changed

.github/workflows/stale.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Close Stale Issues and PRs
2+
3+
on:
4+
schedule:
5+
# Run daily at 2:00 AM UTC
6+
- cron: "0 2 * * *"
7+
workflow_dispatch: # Allow manual triggering
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
contents: read
13+
14+
jobs:
15+
close-stale:
16+
runs-on: ubuntu-latest
17+
name: Close stale Issues and PRs
18+
19+
steps:
20+
- name: Close stale Issues and PRs
21+
# Uses action https://github.com/actions/stale
22+
uses: actions/stale@v10
23+
with:
24+
repo-token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
# Labels to identify stale issues
27+
stale-issue-label: "stale"
28+
stale-pr-label: "stale"
29+
30+
# Marks issues and PRs as stale after 30 days of inactivity
31+
days-before-stale: 30
32+
33+
# Close issues after 7 days of inactivity once marked as stale
34+
days-before-close: 7
35+
36+
# Issues
37+
38+
# Labels that indicate an issue needs more info or is waiting for customer
39+
only-issue-labels: "Needs More Info :information_source:,Waiting for Customer :hourglass_flowing_sand:"
40+
41+
stale-issue-message: |
42+
This issue has been marked as requiring more information or is waiting for a customer response. It has not been updated for more than 30 days.
43+
44+
If you have additional information or would like to provide an update, please respond to this issue. Otherwise, it will be closed automatically in 7 days.
45+
46+
# Message to post when closing the issue
47+
close-issue-message: |
48+
This issue has been automatically closed due to inactivity. It was labeled as stale, and has not been updated since then.
49+
50+
If you believe this issue is still relevant and needs attention, please feel free to reopen it with the additional information requested, or create a new issue with updated details.
51+
52+
Thank you for your contribution to the Microsoft.Data.SqlClient project!
53+
54+
# Don't close issues that have these labels (exemptions)
55+
exempt-issue-labels: "P0,P1,P2"
56+
57+
# Pull Requests
58+
59+
# Message to post when marking the PR as stale
60+
stale-pr-message: |
61+
This pull request has been marked as stale due to inactivity for more than 30 days.
62+
63+
If you would like to keep this pull request open, please provide an update or respond to any comments. Otherwise, it will be closed automatically in 7 days.
64+
65+
# Message to post when closing the PR
66+
close-pr-message: |
67+
This pull request has been automatically closed due to inactivity. It was labeled as stale, and has not been updated since then.
68+
69+
If you believe this pull request is still relevant and needs attention, please feel free to reopen it or create a new pull request with updated changes.
70+
71+
Thank you for your contribution to the Microsoft.Data.SqlClient project!
72+
73+
# Don't mark draft PRs as stale
74+
exempt-draft-pr: true
75+
76+
# Enable debug logging
77+
debug-only: false
78+
79+
# Remove stale label when closing (cleanup)
80+
remove-stale-when-updated: true
81+
82+
# Limit the number of operations per run to avoid API rate limits
83+
operations-per-run: 50
84+
85+
# Enable ascending order (oldest first)
86+
ascending: true

CONTRIBUTING.md

Lines changed: 112 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,79 @@ General contribution guidance is included in this document. Additional guidance
99

1010
The team marks the most straightforward issues as "up for grabs" and issues that are well suited to get you started as "Good first issue". This set of issues is the place to start if you are interested in contributing but new to the codebase.
1111

12-
- [dotnet/sqlclient - :raised_hands: Up-for-Grabs](https://github.com/dotnet/sqlclient/labels/%3Araised_hands%3A%20Up-for-Grabs)
13-
- [dotnet/sqlclient - :sparkles: Good first issue](https://github.com/dotnet/sqlclient/labels/%3Asparkles%3A%20Good%20first%20issue)
12+
- [dotnet/sqlclient - Up-for-Grabs :raised_hands:](https://github.com/dotnet/sqlclient/labels/Up-for-Grabs%20%3Araised_hands%3A)
13+
- [dotnet/sqlclient - :sparkles: Good first issue](https://github.com/dotnet/sqlclient/labels/Good%20first%20issue%20%3Asparkles%3A)
1414

15-
## Contribution "Bar"
15+
## Getting Started
1616

17-
Project maintainers will merge changes that improve the product significantly and broadly and that align with the [Microsoft.Data.SqlClient roadmap](roadmap.md).
17+
1. **Fork** the repository.
18+
2. **Clone** your fork locally.
19+
3. **Create a branch** for your changes.
20+
4. **Build and test** following the [build guide](BUILDGUIDE.md).
21+
5. **Make your changes** following our coding standards.
22+
6. **Submit a pull request** with a clear description.
23+
24+
For detailed build instructions, see [BUILDGUIDE.md](BUILDGUIDE.md).
25+
26+
## Development Process
27+
28+
### Before You Start
29+
30+
- Check existing issues and PRs to avoid duplicates.
31+
- For large changes, create an issue first to discuss the approach.
32+
- Ensure you can build and test the project locally.
33+
34+
### PR Lifecycle
1835

19-
Contributions must also satisfy the other published guidelines defined in this document.
36+
- PRs are automatically marked stale after 30 days of inactivity.
37+
- Stale PRs are closed after 7 additional days.
38+
- Convert PR to Draft to prevent auto-closure.
39+
- All PRs require maintainer approval and passing CI checks.
2040

2141
## DOs and DON'Ts
2242

43+
### Issue Reporting
44+
45+
Please do:
46+
47+
- **DO** report each issue as a new issue (but check first if it's already been reported).
48+
- **DO** respect Issue Templates and provide detailed information.
49+
- **DO** provide a minimal repro app demonstrating the problem.
50+
51+
## Code Contributions
52+
2353
Please do:
24-
- **DO** report each issue as a new issue (but check first if it's already been reported)
25-
- **DO** respect Issue Templates and provide detailed information. It will make the process to reproduce the issue and provide a fix faster.
26-
- **DO** provide a minimal repro app demonstrating the problem in isolation will greatly speed up the process of identifying and fixing problems.
27-
- **DO** follow our [coding style](/policy/coding-style.md) (C# code-specific) when working on a Pull Request.
28-
- **DO** give priority to the current style of the project or file you're changing even if it diverges from the general guidelines.
29-
- **DO** consider cross-platform compatibility and supportability for all supported SQL and Azure Servers and client configurations.
30-
- **DO** include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken.
31-
- **DO** consider concurrency when writing tests. Our pipelines run builds and tests in parallel using the same client and server configurations (in an isolated mode). E.g. Consider using dynamic table/database object names instead of hardcoded values (Use existing tests for reference).
32-
- **DO** keep the discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the discussion.
54+
55+
- **DO** follow our [coding style](/policy/coding-style.md)
56+
- **DO** include tests when adding new features.
57+
- **DO** consider cross-platform compatibility.
58+
- **DO** keep discussions focused.
59+
- **DO** give priority to the current style of the project or file you're changing even if it diverges from general guidelines.
3360
- **DO** blog and tweet (or whatever) about your contributions, frequently!
3461

3562
Please do not:
3663

37-
- **DON'T** make PRs for style changes.
38-
- **DON'T** leave any artifacts on server in tests or leave open resources. Cleaning up all objects is highly appreciated to maintain test server health.
39-
- **DON'T** skip tests or run them conditionally unless necessary. If conditions are not met, test coverage will not be 100%. Use only pre-defined conditions that are already being run in pipelines.
40-
- **DON'T** surprise us with big pull requests. Instead, file an issue and start a discussion so we can agree on a direction before you invest a large amount of time.
41-
- **DON'T** commit code that you didn't write. If you find code that you think is a good fit to add, file an issue and start a discussion before proceeding.
42-
- **DON'T** submit PRs that alter licensing related files or headers. If you believe there's a problem with them, file an issue and we'll be happy to discuss it.
64+
- **DON'T** make PRs for style changes only.
65+
- **DON'T** surprise us with large PRs without prior discussion.
66+
- **DON'T** commit code you didn't write without discussion.
67+
- **DON'T** submit PRs that alter licensing related files or headers. If you believe there's a problem, file an issue first.
4368

44-
## Using Labels
69+
## Testing Requirements
4570

46-
As adding labels [is not possible](https://stackoverflow.com/questions/13829466/how-to-put-a-label-on-an-issue-in-github-if-you-are-not-a-contributor-owner/13829505#13829505) for contributors, please comment in the issue and pull request on what labels should be added.
47-
The below variables are required for new Pull Requests if applicable:
71+
### Test Guidelines
4872

49-
| Label | Description |
50-
| ----- | ----------- |
51-
| [:new: Public API](https://github.com/dotnet/SqlClient/labels/%3Anew%3A%20Public%20API) | Use this variable if a new Public API is added to the Pull Request.
52-
| [:hammer: Breaking Change](https://github.com/dotnet/SqlClient/labels/%3Ahammer%3A%20Breaking%20Change) | Use this variable if the Pull Request breaks an existing API. |
53-
| [Area\Managed SNI](https://github.com/dotnet/SqlClient/labels/Area%5cManaged%20SNI) | Use this label if the issue/PR relates to issues in Managed SNI |
54-
| [Area\Tests](https://github.com/dotnet/SqlClient/labels/Area%5cTests) | Use this label for pull requests that add only tests to the repository. |
73+
- **DO** include tests when adding new features or fixing bugs.
74+
- **DO** use dynamic table/database object names to avoid conflicts in parallel runs.
75+
- **DO** clean up all test objects and close resources properly.
76+
- **DO** consider concurrency - our pipelines run tests in parallel.
77+
- **DON'T** skip tests or run them conditionally unless necessary.
78+
- **DON'T** leave artifacts on test servers or leave open resources.
5579

56-
You can find all possible labels [here](https://github.com/dotnet/SqlClient/labels)
80+
### Test Categories
5781

58-
## Reporting security issues and security bugs
59-
60-
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [secure@microsoft.com](mailto:secure@microsoft.com). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [MSRC FAQ](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue?rtc=1&oneroute=true).
82+
- Unit tests for individual components.
83+
- Functional tests for feature validation.
84+
- Manual tests for complex scenarios requiring SQL Server instances.
6185

6286
## File Headers
6387

@@ -69,15 +93,68 @@ The following file header is used for Microsoft.Data.SqlClient. Please use it fo
6993
// See the LICENSE file in the project root for more information.
7094
```
7195

96+
## Using Labels
97+
98+
As adding labels [is not possible](https://stackoverflow.com/questions/13829466/how-to-put-a-label-on-an-issue-in-github-if-you-are-not-a-contributor-owner/13829505#13829505) for contributors, please comment in the issue and pull request on what labels should be added.
99+
The below labels are required for new Pull Requests if applicable:
100+
101+
| Label | When to Use |
102+
| ----- | ----------- |
103+
| [Public API :new:](https://github.com/dotnet/SqlClient/labels/Public%20API%20%3Anew%3A) | Use this label if a new Public API is added to the Pull Request |
104+
| [Breaking Change :hammer:](https://github.com/dotnet/SqlClient/labels/Breaking%20Change%20%3Ahammer%3A) | Use this label if the Pull Request breaks an existing API |
105+
| [Area\Managed SNI](https://github.com/dotnet/SqlClient/labels/Area%5cManaged%20SNI) | Use this label for Managed SNI related issues/PRs |
106+
| [Area\Tests](https://github.com/dotnet/SqlClient/labels/Area%5cTests) | Use this label for pull requests that add only tests |
107+
108+
You can find all possible labels [here](https://github.com/dotnet/SqlClient/labels)
109+
110+
## Automated Issue and PR Management
111+
112+
This repository uses automated workflows to maintain project hygiene:
113+
114+
### Stale Issues
115+
116+
- Issues labeled "Needs More Info" or "Waiting for Customer" are marked stale after 30 days of inactivity.
117+
- Stale issues are automatically closed after 7 additional days.
118+
- Issues with P0, P1, or P2 priority labels are exempt from auto-closure.
119+
120+
### Stale Pull Requests
121+
122+
- PRs are marked stale after 30 days of inactivity.
123+
- Stale PRs are automatically closed after 7 additional days.
124+
- PRs lin Draft are exempt from auto-closure.
125+
126+
To prevent closure, simply add comments, push commits, or respond to feedback.
127+
128+
## Reporting security issues and vulnerabilities
129+
130+
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [secure@microsoft.com](mailto:secure@microsoft.com). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [MSRC FAQ](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue?rtc=1&oneroute=true).
131+
132+
## Contribution Standards
133+
134+
Project maintainers will merge changes that improve the product significantly and broadly and that align with the [Microsoft.Data.SqlClient roadmap](roadmap.md).
135+
136+
### Requirements
137+
138+
- Changes must be compatible with all supported .NET versions.
139+
- Consider compatibility with supported SQL Server and Azure SQL versions.
140+
- Include appropriate tests and documentation.
141+
- Follow established coding patterns and architecture.
142+
72143
## Contributor License Agreement
73144

74145
You must sign a [.NET Foundation Contribution License Agreement (CLA)](https://cla.dotnetfoundation.org) before your PR will be merged. This is a one-time requirement for projects in the .NET Foundation. You can read more about [Contribution License Agreements (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) on Wikipedia.
75146

76147
The agreement: [contribution-license-agreement.pdf](https://cla.dotnetfoundation.org)
77148

78-
You don't have to do this up-front. You can simply clone, fork, and submit your pull-request as usual. When your pull-request is created, it is classified by a CLA bot. If the change is trivial (for example, you just fixed a typo), then the PR is labelled with `cla-not-required`. Otherwise it's classified as `cla-required`. Once you signed a CLA, the current and all future pull-requests will be labelled as `cla-signed`.
149+
You don't have to do this up-front. You can simply clone, fork, and submit your pull request as usual. When your pull request is created, it is classified by a CLA bot. If the change is trivial (for example, you just fixed a typo), then the PR is labelled with `cla-not-required`. Otherwise it's classified as `cla-required`. Once you signed a CLA, the current and all future pull requests will be labelled as `cla-signed`.
79150

80-
## Code Of Conduct
151+
## Code of Conduct
81152

82153
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
83154
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
155+
156+
## Getting Help
157+
158+
- **Questions**: Use [GitHub Discussions](https://github.com/dotnet/SqlClient/discussions)
159+
- **Bugs**: File an [issue](https://github.com/dotnet/SqlClient/issues/new/choose)
160+
- **Security**: Email [secure@microsoft.com](mailto:secure@microsoft.com)

0 commit comments

Comments
 (0)