Skip to content

Commit

Permalink
Merge pull request #71 from ASFHyP3/develop
Browse files Browse the repository at this point in the history
Release v0.8.0
  • Loading branch information
jtherrmann authored Jun 29, 2023
2 parents 2eabaf5 + f9e6b74 commit 7aff2d0
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ on:
- develop
jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].1
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Create Jira issue

on:
issues:
types: [labeled]

jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_FIELDS: ${{ secrets.JIRA_FIELDS }}
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:

jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].1
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].1
with:
release_prefix: Actions
secrets:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/reusable-create-jira-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
workflow_call:
secrets:
JIRA_BASE_URL:
required: true
JIRA_USER_EMAIL:
required: true
JIRA_API_TOKEN:
required: true
JIRA_PROJECT:
required: true
JIRA_FIELDS:
required: true

jobs:
create-jira-issue:
if: ${{ startsWith(github.event.label.name, 'Jira') }}
runs-on: ubuntu-latest
steps:
- name: Get Jira issue type
id: get_jira_issue_type
run: |
type=$(echo '${{ github.event.label.name }}' | cut -d' ' -f2)
echo "type=$type" >> "$GITHUB_OUTPUT"
- name: Login to Jira
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create Jira issue
id: create_jira_issue
uses: atlassian/gajira-create@v3
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: ${{ steps.get_jira_issue_type.outputs.type }}
summary: ${{ github.event.issue.title }}
description: ${{ github.event.issue.html_url }}
fields: '${{ secrets.JIRA_FIELDS }}'

- name: Add Jira issue key to GitHub issue body
uses: actions-cool/issues-helper@v3
with:
actions: update-issue
body: "**Jira:** ${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_issue.outputs.issue }}\n\
<!-- The previous line was added by GitHub Actions. It should remain as the first line in this description. -->\n\n\
${{ github.event.issue.body }}"
2 changes: 1 addition & 1 deletion .github/workflows/reusable-labeled-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Require Version Bump Labels
uses: mheap/github-action-required-labels@v3
uses: mheap/github-action-required-labels@v4
with:
mode: exactly
count: 1
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/reusable-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ on:
["3.8", "3.9", "3.10"]
description: JSON string containing the list of python versions to test
type: string
fail_fast:
required: false
default: false
description: Cancel all in-progress and queued pytest jobs if any job in the matrix fails
type: boolean

jobs:
pytest:
runs-on: ubuntu-latest

strategy:
fail-fast: ${{ inputs.fail_fast }}
matrix:
python_version: ${{ fromJson(inputs.python_versions) }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on: push

jobs:
call-secrets-analysis-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].1
2 changes: 1 addition & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].1
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.8.0]

### Added
* Added [`reusable-create-jira-issue.yml`](./.github/workflows/reusable-create-jira-issue.yml) for creating a Jira
issue that corresponds to the labeled GitHub issue.
* [`reusable-pytest.yml`](.github/workflows/reusable-pytest.yml) now includes a `fail_fast` option which lets you specify
[the strategy for handling failures](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast)

## [0.7.1]

### Fixed
Expand Down
87 changes: 67 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.8.0
with:
user: tools-bot # Optional; default shown
email: [email protected] # Optional; default shown
Expand Down Expand Up @@ -57,13 +57,56 @@ on:
jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.8.0
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

to ensure the changelog has been updated for any PR to `develop` or `main`.

### [`reusable-create-jira-issue.yml`](./.github/workflows/reusable-create-jira-issue.yml)

Creates a Jira issue that corresponds to the labeled GitHub issue. Use like:

```yaml
name: Create Jira issue
on:
issues:
types: [labeled]
jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_FIELDS: ${{ secrets.JIRA_FIELDS }}
```

The `JIRA_FIELDS` secret stores additional fields in JSON format. For example, to assign the issue to a particular
sprint, supply the following value:

```json
{"customfield_XXXXX": 42}
```

where `customfield_XXXXX` is the custom field name of the sprint field and `42` is the ID of the particular sprint.

It would seem that the custom field name of the sprint field is not the same across all Jira deployments and projects.
Therefore, to determine both the custom field name and the sprint ID, do the following:

1. Choose any issue that belongs to the particular sprint and run the `curl` command for the Jira API's
[Get issue](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get)
endpoint, supplying the issue key.
2. Search the JSON response for the name of the sprint. You should find something like the following
(there will be other fields such as `boardId` present in the object, but they are not shown below):
```json
"customfield_XXXXX":[{"id":42,"name":"MySprint"}]
```

### [`reusable-docker-ecr.yml`](./.github/workflows/reusable-docker-ecr.yml)

Builds a Docker image from the `Dockerfile` in the repository root and pushes it to the
Expand All @@ -87,13 +130,13 @@ on:
jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.8.0
with:
conda_env_name: hyp3-plugin
call-docker-ecr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ecr.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ecr.yml@v0.8.0
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
ecr_registry: 845172464411.dkr.ecr.us-west-2.amazonaws.com
Expand Down Expand Up @@ -128,20 +171,20 @@ on:
jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.8.0
with:
conda_env_name: hyp3-plugin
call-docker-ghcr-workflow:
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.8.0
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
user: ${{ github.actor }}
release_branch: main # Optional; default shown
develop_branch: develop # Optional; default shown
user: tools-bot # Optional; default shown
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

### [`reusable-flake8.yml`](./.github/workflows/reusable-flake8.yml)
Expand All @@ -155,7 +198,7 @@ on: push
jobs:
call-flake8-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@v0.8.0
with:
local_package_names: hyp3_plugin # Required; comma-seperated list of names that should be considered local to your application
excludes: hyp3_plugin/ugly.py # Optional; comma-separated list of glob patterns to exclude from checks
Expand Down Expand Up @@ -183,7 +226,7 @@ on:
jobs:
call-git-object-name-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-git-object-name.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-git-object-name.yml@v0.8.0
echo-git-object-name-outputs:
needs: call-git-object-name-workflow
Expand Down Expand Up @@ -213,7 +256,7 @@ on:
jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.8.0
```
to ensure a release label is included on any PR to `main`.

Expand All @@ -237,11 +280,11 @@ on:
jobs:
call-pytest-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.8.0
with:
local_package_name: hyp3_plugin # Required; package to produce a coverage report for
# Optional; default shown
python_versions: >-
fail_fast: false # Optional; default shown
python_versions: >- # Optional; default shown
["3.8", "3.9", "3.10"]
```

Expand All @@ -266,7 +309,7 @@ on:
jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.8.0
with:
release_prefix: HyP3-CI
release_branch: main # Optional; default shown
Expand All @@ -277,13 +320,15 @@ jobs:
```
to create a release for every newly pushed version tag.

### [`reusable-relese-checklist-comment.yml`](.github/workflows/reusable-release-checklist-comment.yml)
### [`reusable-release-checklist-comment.yml`](.github/workflows/reusable-release-checklist-comment.yml)

Add a comment to PRs when they are opened with a release checklist for developers and reviewers.

Use like:

```yaml
name: Create Release Comment
on:
pull_request:
types:
Expand All @@ -292,8 +337,10 @@ on:
- main
jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
call-release-checklist-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
permissions:
pull-requests: write
with:
# optional; example shown
additional_developer_items: '- [ ] If the step function code has changed, have you drained the job queue before merging?'
Expand All @@ -320,7 +367,7 @@ on: push
jobs:
call-secrets-analysis-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.8.0
```
to scan every push for secrets.

Expand All @@ -346,7 +393,7 @@ on:
jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.7.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.8.0
with:
python_version: '3.9' # Optional; default shown
Expand Down

0 comments on commit 7aff2d0

Please sign in to comment.