We are working on improvements to the 1Password for Open Source program. This PR continues sets up the workflow and logic to handle when an application is approved.
What's changed?
The focus of the changes here are related to when a reviewer has taken a look at the application, determined it is approved, and applies the status: approved label to the issue.
Adding the label will kick off a workflow that runs the processor with some additional details about who approved the application
The processor will run in approve mode, taking in the details about who approved the application
We'll check if the issue is open, has the correct label, and is still a valid application
Once everything is confirmed, the application data is added to the repository via commit:
We'll use the data we've collected and validated via the issue body and render it as JSON
The data will be committed to a new file under the data directory made up of the issue ID and project name, e.g. data/295-foo.json
The commit will occur on main
The issue is then closed with a helpful comment from the bot, indicating who approved the application, what to expect, and some suggestions.
Testing
There are no new unit/integration tests in this PR (more testing setup underway). The manual testing flow to help debug and observe the behaviour when approving in the application processor has been updated. Here's how to test this out:
git checkout jh/approve-merge
make install_deps && make build_processor
./processor approve --test-issue <issue-name>
You can use this against any of the test issues in the repo, but unless it has the status: approved label it will result in one of the following errors:
Issue closed
You'll receive the error
Error approving application: script run on closed issue
Issue not approved
You'll receive the error
Error approving application: script run on issue that does not have required 'status: approved' label
Application invalid
You'll receive the error
Error approving application: script run on issue with invalid application data:
- ... list of errors ...
It's worth noting that these are all considered edge cases but in theory are all still possible. All of these scenarios will not result in any comment from the bot or label changes.
The application contents are committed to the repository:
Output
```
Commiting the following contents to a file located at "data/6-testdb.json" with the commit message "Added "TestDB" to program":
{
"account": "testdb.1password.com",
"project": {
"name": "TestDB",
"description": "TestDB is a free and open source, community-based forum software project.",
"contributors": 1,
"home_url": "https://github.com/wendyappleed/test-db",
"repo_url": "https://github.com/wendyappleed/test-db",
"license_type": "MIT",
"license_url": "https://github.com/wendyappleed/test-db/blob/main/LICENSE.md",
"is_event": false,
"is_team": false
},
"applicant": {
"name": "Wendy Appleseed",
"email": "wendyappleseed@example.com",
"role": "Core Maintainer",
"id": 38230737
},
"can_contact": true,
"approver_id": 123,
"issue_number": 6,
"created_at": "2023-07-12T19:49:35Z"
}
```
The bot will post a helpful message
Bot approval message
### 🎉 Your application has been approved
Congratulations, @approver-username has approved your application! A promotion will be applied to your 1Password account shortly.
If you haven't done so already, we highly recommend implementing a [recovery plan for your team](https://support.1password.com/team-recovery-plan/) in case access for a particular contributor is ever lost. You may add additional core contributors as you see fit.
Finally, we'd love to hear more about your experience using 1Password in your development workflows! Feel free to join us over on the [1Password Developers Slack](https://join.slack.com/t/1password-devs/shared_invite/zt-15k6lhima-GRb5Ga~fo7mjS9xPzDaF2A) workspace.
Welcome to the program and happy coding! 🧑💻
/dev/web/developer.1password.com/-/issues/1066
Summary
We are working on improvements to the 1Password for Open Source program. This PR continues sets up the workflow and logic to handle when an application is approved.
What's changed?
The focus of the changes here are related to when a reviewer has taken a look at the application, determined it is approved, and applies the
status: approved
label to the issue.approve
mode, taking in the details about who approved the applicationdata
directory made up of the issue ID and project name, e.g.data/295-foo.json
main
Testing
There are no new unit/integration tests in this PR (more testing setup underway). The manual testing flow to help debug and observe the behaviour when approving in the application processor has been updated. Here's how to test this out:
You can use this against any of the test issues in the repo, but unless it has the
status: approved
label it will result in one of the following errors:Issue closed
You'll receive the error
Issue not approved
You'll receive the error
Application invalid
You'll receive the error
It's worth noting that these are all considered edge cases but in theory are all still possible. All of these scenarios will not result in any comment from the bot or label changes.
Happy path
With this command you'll see a few things happen:
Output
``` Commiting the following contents to a file located at "data/6-testdb.json" with the commit message "Added "TestDB" to program": { "account": "testdb.1password.com", "project": { "name": "TestDB", "description": "TestDB is a free and open source, community-based forum software project.", "contributors": 1, "home_url": "https://github.com/wendyappleed/test-db", "repo_url": "https://github.com/wendyappleed/test-db", "license_type": "MIT", "license_url": "https://github.com/wendyappleed/test-db/blob/main/LICENSE.md", "is_event": false, "is_team": false }, "applicant": { "name": "Wendy Appleseed", "email": "wendyappleseed@example.com", "role": "Core Maintainer", "id": 38230737 }, "can_contact": true, "approver_id": 123, "issue_number": 6, "created_at": "2023-07-12T19:49:35Z" } ```Bot approval message
### 🎉 Your application has been approved Congratulations, @approver-username has approved your application! A promotion will be applied to your 1Password account shortly. If you haven't done so already, we highly recommend implementing a [recovery plan for your team](https://support.1password.com/team-recovery-plan/) in case access for a particular contributor is ever lost. You may add additional core contributors as you see fit. Finally, we'd love to hear more about your experience using 1Password in your development workflows! Feel free to join us over on the [1Password Developers Slack](https://join.slack.com/t/1password-devs/shared_invite/zt-15k6lhima-GRb5Ga~fo7mjS9xPzDaF2A) workspace. Welcome to the program and happy coding! 🧑💻