maintenance: New contribution rules

This commit is contained in:
kd-11 committed 2026-10-24 17:34:44 +03:00
1 parent e20ff4b6d4
commit 4725bb277e
3 files changed
+167 -11

No files matched your search

+47 -1
View File
@@ -16,4 +16,50 @@ Submitting your test results for Commercial Games must be done on our forums. Pl
# Contributing
Check the [Coding Style Guidelines](https://github.com/RPCS3/rpcs3/wiki/Coding-Style) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information). If you have any questions, hit us up on our [Discord Server](https://discord.gg/rpcs3) in the **#development** channel.
Thank you for wanting to help improve RPCS3! Check the [Coding Style Guidelines](https://github.com/RPCS3/rpcs3/wiki/Coding-Style) and [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information). If you have any questions, hit us up on our [Discord Server](https://discord.gg/rpcs3) in the **#development** channel.
## Talk to us before you write code
RPCS3 is maintained by a small team of volunteers, and every pull request takes real time to review, test across many games and hardware configurations, and maintain afterwards. A change that looks simple can have side effects that only someone familiar with that part of the emulator will spot.
So if you have a new idea, fix or feature in mind, **please discuss it with us first** instead of opening a pull request straight away:
- Reach out to the developers in the **#development** channel on our [Discord Server](https://discord.gg/rpcs3), or
- [Open an issue](https://github.com/RPCS3/rpcs3/issues/new/choose) (or comment on an existing one) describing what you want to change, why, and how you plan to approach it.
This lets us tell you early whether the change is wanted, whether someone is already working on it, and what pitfalls to look out for. It saves you from spending effort on something that cannot be merged, and it saves us from reviewing it.
## Pull requests from first-time contributors
To keep the review workload manageable, pull requests are checked automatically when they are opened:
- **If you have had a commit merged into RPCS3 before**, or you are a member or collaborator of the project, you can open pull requests as usual.
- **If this is your first contribution**, your pull request must be linked to an issue that a maintainer has **assigned to you**. Pull requests without one are closed automatically.
The process for new contributors is:
1. Discuss your idea on Discord or in a GitHub issue, as described above.
2. Once a maintainer agrees with the approach, they will assign the issue to you. If the discussion happened on Discord, an issue will be created (or you can create one) so it can be assigned.
3. Open your pull request against the `master` branch and include `Fixes #<issue number>` (or `Closes #<issue number>`) in its description.
If your pull request was closed by the automation, you do not need to open a new one. Once the issue is assigned to you, edit the pull request's description to add the issue reference and it will be reopened automatically.
Once your first pull request has been merged, the check no longer applies to you.
## Testing
Please test your changes before submitting them. At minimum, the code must build and the emulator must run the games or features affected by your change. Describe in the pull request what you tested and on which hardware and operating system. If your change affects rendering, CPU emulation or other areas that impact many games, test more than one title.
## AI Use
Use of AI tools for research and reverse engineering purposes is permitted. However, contributors are expected to fully own and understand all code they submit. Any communication with the team — including code, code comments, and GitHub comments — must come from the human contributor, not an AI agent acting autonomously.
We have unfortunately seen a rise in untested and unverified AI-generated slop being submitted to this project. This wastes maintainer time and, in worse cases, such changes get merged and break functionality for all users. Repeated violations will result in a ban from the repository. Please be respectful of everyone's time.
**Pull requests opened by AI agents or automated tools must include a disclosure in the PR description** stating the scope of AI involvement — which parts were AI-generated and what human testing or review was performed prior to submission. PRs that omit this disclosure may be closed without review.
If you are unsure about your work, open a discussion issue to talk it through with the team, or reach out to a maintainer on [Discord](https://discord.gg/RPCS3).
## For maintainers
The check is implemented in [`.github/workflows/pr-gate.yml`](workflows/pr-gate.yml). To let a pull request through without an assigned issue, either add the `Gate: Approved` label, or reopen the pull request yourself, which applies the label automatically. Pull requests closed by the automation carry the `Needs Assigned Issue` label.
+116
View File
@@ -0,0 +1,116 @@
name: PR Gate
# Pull requests from people who have never had a commit merged must link an
# issue they have been assigned to. See .github/CONTRIBUTING.md.
on:
pull_request_target:
types:
- opened
- reopened
- edited
concurrency:
group: pr-gate-${{ github.event.pull_request.number }}
jobs:
Gate_PRs:
name: Check contributor status
runs-on: ubuntu-latest
if: github.repository == 'RPCS3/rpcs3'
permissions:
issues: read
pull-requests: write
steps:
- name: Check for an assigned issue
uses: actions/github-script@v9
with:
retries: 3
script: |
// Commit authors, collaborators and org members are trusted
const TRUSTED = ['OWNER', 'MEMBER', 'COLLABORATOR', 'CONTRIBUTOR'];
// Applied by the bot to PRs it closed, so they can be reopened automatically
const GATED = 'Needs Assigned Issue';
// Applied by a maintainer to let a PR through regardless
const APPROVED = 'Gate: Approved';
const pr = context.payload.pull_request;
const author = pr.user.login;
const labels = pr.labels.map(x => x.name);
const target = {...context.repo, issue_number: pr.number};
if (TRUSTED.includes(pr.author_association) || labels.includes(APPROVED)) {
return;
}
// Only the author or someone with write access can reopen. If it was not the author, treat it as a maintainer override
if (context.payload.action === 'reopened' && context.payload.sender.login !== author) {
console.log(`Reopened by ${context.payload.sender.login}, approving`);
await github.rest.issues.addLabels({...target, labels: [APPROVED]});
if (labels.includes(GATED)) {
await github.rest.issues.removeLabel({...target, name: GATED});
}
return;
}
// Leave PRs closed for any other reason (or merged) alone
if (pr.state === 'closed' && !labels.includes(GATED)) {
return;
}
const {repository: {pullRequest: pull}} = await github.graphql(`
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
closingIssuesReferences(first: 50) {
nodes {
number
repository { nameWithOwner }
assignees(first: 50) { nodes { login } }
}
}
}
}
}`, {...context.repo, number: pr.number});
const repoName = `${context.repo.owner}/${context.repo.repo}`;
const assigned = pull.closingIssuesReferences.nodes.filter(issue =>
issue.repository.nameWithOwner === repoName &&
issue.assignees.nodes.some(x => x.login.toLowerCase() === author.toLowerCase()));
const guide = `https://github.com/${repoName}/blob/${context.payload.repository.default_branch}/.github/CONTRIBUTING.md`;
if (assigned.length > 0) {
if (labels.includes(GATED)) {
console.log(`Linked to assigned issue #${assigned[0].number}, reopening`);
if (pr.state === 'closed') {
await github.rest.pulls.update({...context.repo, pull_number: pr.number, state: 'open'});
}
await github.rest.issues.removeLabel({...target, name: GATED});
await github.rest.issues.createComment({...target, body:
`Thanks! This pull request is now linked to #${assigned[0].number}, which is assigned to you, so it has been reopened for review.`});
}
return;
}
if (pr.state === 'closed') {
// Still gated, nothing changed
return;
}
console.log(`@${author} (${pr.author_association}) has no assigned linked issue, closing`);
await github.rest.issues.addLabels({...target, labels: [GATED]});
await github.rest.issues.createComment({...target, body: [
`Hi @${author}, thank you for your interest in contributing to RPCS3!`,
'',
'To keep the review workload manageable, pull requests from first-time contributors must be linked to an issue that a maintainer has assigned to you. ' +
'This pull request does not reference such an issue, so it has been closed automatically.',
'',
'To get it reopened:',
'1. Open an issue (or comment on an existing one) describing what you want to change and why, or talk to us in the **#development** channel on [Discord](https://discord.gg/rpcs3).',
'2. Once a maintainer agrees with the approach, they will assign the issue to you.',
'3. Edit this pull request\'s description to include `Fixes #<issue number>`. It will be reopened automatically.',
'',
`Please read the [contribution guidelines](${guide}) for more details, including our policy on AI-assisted contributions.`,
].join('\n')});
await github.rest.pulls.update({...context.repo, pull_number: pr.number, state: 'closed'});
+4 -10
View File
@@ -21,17 +21,11 @@ If you want to contribute as a developer, please take a look at the following pa
* [Coding Style](https://github.com/RPCS3/rpcs3/wiki/Coding-Style)
* [Developer Information](https://github.com/RPCS3/rpcs3/wiki/Developer-Information)
You should also contact any of the developers in the forums or in the Discord server to learn more about the current state of the emulator.
**Before opening a pull request, please read our [contribution guidelines](.github/CONTRIBUTING.md).** In short:
### AI Use
Use of AI tools for research and reverse engineering purposes is permitted. However, contributors are expected to fully own and understand all code they submit. Any communication with the team — including code, code comments, and GitHub comments — must come from the human contributor, not an AI agent acting autonomously.
We have unfortunately seen a rise in untested and unverified AI-generated slop being submitted to this project. This wastes maintainer time and, in worse cases, such changes get merged and break functionality for all users. Repeated violations will result in a ban from the repository. Please be respectful of everyone's time.
**Pull requests opened by AI agents or automated tools must include a disclosure in the PR description** stating the scope of AI involvement — which parts were AI-generated and what human testing or review was performed prior to submission. PRs that omit this disclosure may be closed without review.
If you are unsure about your work, open a discussion issue to talk it through with the team, or reach out to a maintainer on [Discord](https://discord.gg/RPCS3).
* Discuss new ideas with the developers first, either in the **#development** channel on [Discord](https://discord.gg/RPCS3) or by opening a GitHub issue.
* Pull requests from first-time contributors must link an issue that a maintainer has assigned to them (`Fixes #<issue number>` in the description). Pull requests without one are closed automatically.
* Test your changes before submitting them. AI-assisted contributions must be disclosed, and you must fully understand and own any code you submit. See the [AI use policy](.github/CONTRIBUTING.md#ai-use).
## Building