Skip to content

Commit a25f6dc

Browse files
authored
Merge pull request #104 from ASFHyP3/develop
Release v0.5.1
2 parents 7c4382e + de87d68 commit a25f6dc

File tree

13 files changed

+107
-69
lines changed

13 files changed

+107
-69
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
77
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [0.5.1]
10+
11+
### Added
12+
- Added `permissions` field for every GitHub Actions job in the cookiecutter template, to address https://github.com/ASFHyP3/actions/issues/220
13+
14+
### Changed
15+
- Upgraded `ASFHyP3/actions` reusable actions to `v0.18.1`.
16+
17+
### Removed
18+
- Removed the `sync_pr_label` input from the call to `reusable-release.yml`, so that the default value will be used.
19+
20+
### Fixed
21+
- Updated README instructions for creating a HyP3 plugin. In particular, added instructions for granting the GitHub user account (e.g. `tools-bot` for `ASFHyP3` repos) sufficient permissions for performing releases.
22+
- The `python_version` parameter is now provided to `reusable-version-info.yml` in the `test-and-build.yml` template.
23+
- Changed the value of the `user` parameter for `reusable-docker-ghcr.yml` from `{{ cookiecutter.github_username }}` to `{{ '${{ github.actor }}' }}`, to match the example given by the [actions README](https://github.com/ASFHyP3/actions/blob/v0.18.0/README.md#reusable-docker-ghcryml).
924

1025
## [0.5.0]
1126
### Added

README.md

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To create a new plugin, you'll first need to run [`cookiecutter`](https://cookie
1414
mamba install cookiecutter
1515
```
1616

17-
or [`pip`](https://packaging.python.org/en/latest/tutorials/installing-packages/#use-pip-for-installing):
17+
or [`pip`](https://packaging.python.org/en/latest/tutorials/installing-packages/#use-pip-for-installing):
1818

1919
```bash
2020
python -m pip install cookiecutter
@@ -113,44 +113,54 @@ git push -u origin develop
113113

114114
Once the zeroth release is pushed to GitHub, we need to configure the GitHub repository settings.
115115
The settings detailed here are not required, but we **STRONGLY** recommend them as they make it much
116-
easier for others to collaborate on your project, and for you to control how the collaboration
117-
occurs.
118-
119-
Go to your repository in GitHub and on the right, click "Settings", then:
120-
1. In main page:
121-
* In the "Pull Requests" section
122-
* un-click "Allow squash merging"
123-
* Make sure "Automatically delete head branches" is clicked
124-
* See [Pull Request section screenshot](#pr-rules) for configuration image
125-
2. In "Branches":
126-
* make sure the default branch is "develop"
127-
* Add a "Branch protection rule" for:
128-
* main:
129-
* set "Branch name pattern" to "main"
130-
* click "Require pull request review before merging"
131-
* click "Dismiss stale pull request approvals when new commits are pushed"
132-
* click "Require status checks to pass before merging"
133-
* click "Do not allow bypassing of the above settings"
134-
* click "Restrict who can push to matching branches"
135-
* Create
136-
* See [Main branch rules section screenshot](#main-branch-rules) for configuration image
137-
* develop:
138-
* set "Branch name pattern" to "develop"
139-
* click "Require pull request review before merging"
140-
* click "Require status checks to pass before merging"
141-
* click "Do not allow bypassing of the above settings"
142-
* Create
143-
* See [Develop branch rules section screenshot](#develop-branch-rules) for configuration image
144-
145-
For both the `main` and `develop` you can restrict who can push to the branch.
146-
In the same page where you set the above options, you can also click "Restrict
147-
who can push to matching branches", then search and add the desired people/organizations
148-
who are allowed to push. If you set this, make sure you include the owner of your
149-
repository in this list - other your GitHub Actions won't work!
116+
easier for others to collaborate on your project, and for you to control how the collaboration occurs.
117+
118+
Go to your repository in GitHub and click "Settings", then:
119+
1. In "General":
120+
* Change the "Default branch" to `develop`
121+
* In the "Pull Requests" section:
122+
* disable "Allow squash merging"
123+
* enable "Always suggest updating pull request branches"
124+
* enable "Allow auto-merge"
125+
* enable "Automatically delete head branches"
126+
2. In "Collaborators and teams":
127+
* If the user you provided for the `github_username` prompt when running the cookiecutter
128+
does not already have access to all repos at the organization level,
129+
add the user under "Direct access" with `Role: write`.
130+
For https://github.com/ASFHyP3 repos, you should add the `ASFHyP3/automation` team here,
131+
which includes the `tools-bot` user.
132+
3. In "Branches", add a "classic branch protection rule" for:
133+
* `main`:
134+
* set "Branch name pattern" to `main`
135+
* enable "Require a pull request before merging"
136+
* enable "Require approvals"
137+
* enable "Dismiss stale pull request approvals when new commits are pushed"
138+
* enable "Require status checks to pass before merging"
139+
* enable "Require branches to be up to date before merging"
140+
* specify the status checks that you want to be required before merging
141+
* enable "Do not allow bypassing the above settings"
142+
* enable "Restrict who can push to matching branches"
143+
* confirm that this defaults to "Organization administrators, repository administrators, and users with the Maintain role."
144+
* `develop`:
145+
* set "Branch name pattern" to `develop`
146+
* enable "Require a pull request before merging"
147+
* enable "Require approvals"
148+
* enable "Dismiss stale pull request approvals when new commits are pushed"
149+
* enable "Allow specified actors to bypass required pull requests"
150+
* Add the user that you provided for the `github_username` prompt when running the cookiecutter.
151+
This is required for allowing the [`reusable-release.yml`](https://github.com/ASFHyP3/actions/#reusable-releaseyml)
152+
workflow to merge `main` back into `develop` after a release.
153+
For https://github.com/ASFHyP3 repos, you should add the `ASFHyP3/automation` team here,
154+
which includes the `tools-bot` user.
155+
* enable "Do not allow bypassing the above settings"
156+
* enable "Restrict who can push to matching branches"
157+
* confirm that this defaults to "Organization administrators, repository administrators, and users with the Maintain role."
158+
* Add the user that you provided for the `github_username` prompt when running the cookiecutter.
159+
For https://github.com/ASFHyP3 repos, you should add the `ASFHyP3/automation` team here,
160+
which includes the `tools-bot` user.
150161

151162
For more information on how to contribute to repositories set up in this manner,
152-
check out GitHub's [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
153-
article
163+
check out GitHub's [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow) article.
154164

155165
### 6. Create a personal access key for GitHub Actions
156166

@@ -184,15 +194,9 @@ So, if it doesn't already exist, we will need to create the token.
184194
This access token will regularly expire unless you set them to last forever (which we don't recommend)
185195
so make sure to keep the token current and the secret up to date!
186196

187-
### 7. Restart the GitHub Actions
197+
### 7. Make HyP3 plugin container public
188198

189-
Now you're all setup! You should be able to navigate to your repository "Actions",
190-
restart the failed Workflows on `develop`, and watch it create minimal HyP3 plugin
191-
container for your process.
192-
193-
### 8. Make HyP3 plugin container public
194-
195-
Once the Actions have successfully run, a containerized version of your plugin will be
199+
Once the "Test and build" GitHub Actions workflow has successfully run, a containerized version of your plugin will be
196200
available in the GitHub Container Registry (GHCR). You can find this plugin in the "Packages"
197201
section of your GitHub user/organization account. You can also `pull` it to your local
198202
machine for use using the command:
@@ -203,16 +207,14 @@ GHCR containers are private by default. You'll need to manually change the visib
203207
your container to "Public" so that HyP3 can access it. See this [GitHub Documentation](https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#configuring-visibility-of-packages-for-your-personal-account)
204208
for a step-by-step guide.
205209

206-
## Screenshots
210+
### 8. Initial release
207211

208-
### PR Rules
209-
![PR Rules screenshot](assets/PR_rules.png)
212+
After you've developed the basic functionality of your plugin,
213+
perform an initial release by opening and merging a PR from `develop` to `main`.
214+
This should create a `v0.1.0` release, assuming you did not change the `[0.1.0]` heading
215+
in the [CHANGELOG](./{{cookiecutter.__project_name}}/CHANGELOG.md).
210216

211-
### Main Branch Rules
212-
![Main Branch Rules screenshot](assets/main_rules.png)
213-
214-
### Develop Branch Rules
215-
![Develop Branch Rules screenshot](assets/develop_rules.png)
217+
## Screenshots
216218

217219
### GITHUB_PAK Permissions
218220
![GITHUB_PAK Permissions screenshot](assets/PAK_permissions.png)

assets/PR_rules.png

-239 KB
Binary file not shown.

assets/develop_rules.png

-1.62 MB
Binary file not shown.

assets/main_rules.png

-1.86 MB
Binary file not shown.

{{cookiecutter.__project_name}}/.github/workflows/changelog.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ on:
1414
jobs:
1515
call-changelog-check-workflow:
1616
# Docs: https://github.com/ASFHyP3/actions
17-
uses: ASFHyP3/actions/.github/workflows/[email protected]
17+
uses: ASFHyP3/actions/.github/workflows/[email protected]
18+
permissions:
19+
contents: read

{{cookiecutter.__project_name}}/.github/workflows/labeled-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ on:
1313
jobs:
1414
call-labeled-pr-check-workflow:
1515
# Docs: https://github.com/ASFHyP3/actions
16-
uses: ASFHyP3/actions/.github/workflows/[email protected]
16+
uses: ASFHyP3/actions/.github/workflows/[email protected]
17+
permissions:
18+
pull-requests: read

{{cookiecutter.__project_name}}/.github/workflows/release-checklist-comment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ on:
88
- main
99

1010
jobs:
11-
call-release-workflow:
11+
call-release-checklist-workflow:
1212
# Docs: https://github.com/ASFHyP3/actions
13-
uses: ASFHyP3/actions/.github/workflows/[email protected].0
13+
uses: ASFHyP3/actions/.github/workflows/[email protected].1
1414
permissions:
1515
pull-requests: write
1616
secrets:

{{cookiecutter.__project_name}}/.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
jobs:
99
call-release-workflow:
1010
# Docs: https://github.com/ASFHyP3/actions
11-
uses: ASFHyP3/actions/.github/workflows/[email protected]
11+
uses: ASFHyP3/actions/.github/workflows/[email protected]
12+
permissions: {}
1213
with:
1314
release_prefix: {{ cookiecutter.__project_title }}
1415
release_branch: main
1516
develop_branch: develop
16-
sync_pr_label: actions-bot
1717
secrets:
1818
USER_TOKEN: {{ cookiecutter.__user_github_token }}

{{cookiecutter.__project_name}}/.github/workflows/static-analysis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ on: push
55
jobs:
66
call-secrets-analysis-workflow:
77
# Docs: https://github.com/ASFHyP3/actions
8-
uses: ASFHyP3/actions/.github/workflows/[email protected]
8+
uses: ASFHyP3/actions/.github/workflows/[email protected]
9+
permissions:
10+
contents: read
911

1012
call-ruff-workflow:
1113
# Docs: https://github.com/ASFHyP3/actions
12-
uses: ASFHyP3/actions/.github/workflows/[email protected]
14+
uses: ASFHyP3/actions/.github/workflows/[email protected]
15+
permissions:
16+
contents: read
1317

1418
call-mypy-workflow:
1519
# Docs: https://github.com/ASFHyP3/actions
16-
uses: ASFHyP3/actions/.github/workflows/[email protected]
20+
uses: ASFHyP3/actions/.github/workflows/[email protected]
21+
permissions:
22+
contents: read

0 commit comments

Comments
 (0)