Skip to content

Commit

Permalink
Update labeler GitHub workflows (#2690)
Browse files Browse the repository at this point in the history
* Update GitHub labeler

* More updates to labeler.yml

* Update changelog/README.rst to be consistent with labeling scheme

* Update lists of labels to remove after pull requests

* Update changelog guide

* Fix an rst error...

* Update patterns for adding no changelog label

* Update add no changelog label action

* Update when action gets run

* Remove workflow_dispatch option

* Mark test as flaky
  • Loading branch information
namurphy committed May 15, 2024
1 parent 2af0dba commit 3cb0339
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 46 deletions.
176 changes: 143 additions & 33 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,107 +6,217 @@
# If a label includes a space or a pattern begins with an asterisk or
# special character, enclose it in quotes.

'changes existing API':
'breaking change':
- changed-files:
- any-glob-to-any-file: 'changelog/*.breaking*.rst'
- any-glob-to-any-file: 'changelog/*breaking*.rst'

bug:
bugfix:
- changed-files:
- any-glob-to-any-file: 'changelog/*.bugfix*.rst'
- any-glob-to-any-file: 'changelog/*bugfix*.rst'

'CI':
CI:
- changed-files:
- any-glob-to-any-file: [
'codecov.yaml',
'.github/workflows/*test*.yml',
'.pre-commit-config.yaml',
'.readthedocs.yml',
'CODEOWNERS',
'codecov.yaml',
'mypy.ini',
'noxfile.py',
'tox.ini'
'tox.ini',
'*azure*',
'*appveyor*',
]

'contributor guide':
- changed-files:
- any-glob-to-any-file: ['changelog/README.rst', 'docs/contributing/**/*']
- any-glob-to-any-file: [
'changelog/README.rst',
'docs/contributing/**'
]

requirements:
- changed-files:
- any-glob-to-any-file: [
'**/*req*.txt',
'**/environment.y*ml',
'*requirements*/**/*.txt'
]

dependencies:
'deprecation or planned removal':
- changed-files:
- any-glob-to-any-file: '**/*requirements*.txt'
- any-glob-to-any-file: 'changelog/*removal*.rst'

docs:
- changed-files:
- any-glob-to-any-file: ['.readthedocs.yml', 'changelog/*doc*.rst', 'docs/**/*', 'README.md']
- any-glob-to-any-file: [
'docs/**/*.bib',
'docs/**/*.ico',
'docs/**/*.ipynb',
'docs/**/*.md',
'docs/**/*.png',
'docs/**/*.rst',
'docs/**/*.svg'
]

'documentation infrastructure':
- changed-files:
- any-glob-to-any-file: [
'.github/workflows/linkcheck.yml',
'.readthedocs.yml',
'docs/**/*.css',
'docs/**/*.html',
'docs/**/*.py',
'docs/**/make.bat',
'docs/**/Makefile',
'docs/**/plasmapy_sphinx/**',
'docs/**/robots.txt'
]

feature:
- changed-files:
- any-glob-to-any-file: 'changelog/*feature*.rst'

'GitHub Actions':
- changed-files:
- any-glob-to-any-file: '.github/**/*'
- any-glob-to-any-file: '.github/**'

linters:
- changed-files:
- any-glob-to-any-file: ['.sourcery.yaml', '.pre-commit-config.yaml']
- any-glob-to-any-file: [
'**/*flake8*',
'*lint*',
'*pep8speaks*',
'*style*',
'.editorconfig',
'.pre-commit*.yaml',
'.sourcery.yaml'
]

maintenance:
- changed-files:
- any-glob-to-any-file: [
'**/CONTRIBUTING.md',
'**/README.*',
'.git-blame-ignore-revs',
'.gitattributes',
'.gitignore',
'.mailmap',
'changelog/*.internal*.rst',
'CODEOWNERS',
'licenses/**'
]

notebooks:
- changed-files:
- any-glob-to-any-file: 'docs/notebooks/**/*'
- any-glob-to-any-file: [
'**/*.ipynb',
'**/binder/**',
'.jupyter/**',
'docs/notebooks/**'
]

nox:
- changed-files:
- any-glob-to-any-file: '**/noxfile.py'

packaging:
- changed-files:
- any-glob-to-any-file: [
'**/scm_version.py',
'*setup*',
'.github/workflows/*publish*',
'.github/workflows/*pypi*',
'.github/workflows/*release*',
'.zenodo*',
'CITATION.cff',
'LICENSE.md',
'MANIFEST.in',
'PATENT.md',
'pyproject.toml',
'setup.*'
'pyproject.toml'
]

'physical data':
- changed-files:
- any-glob-to-any-file: [
'**/particles/data/**',
'**/tools/export_ionization_energy.py'
]

plasmapy.analysis:
- changed-files:
- any-glob-to-any-file: 'plasmapy/analysis/**/*'
- any-glob-to-any-file: '**/analysis/**'

plasmapy.diagnostics:
- changed-files:
- any-glob-to-any-file: 'plasmapy/diagnostics/**/*'
- any-glob-to-any-file: '**/diagnostics/**'

plasmapy.dispersion:
- changed-files:
- any-glob-to-any-file: 'plasmapy/dispersion/**/*'
- any-glob-to-any-file: '**/dispersion/**'

plasmapy.formulary:
- changed-files:
- any-glob-to-any-file: 'plasmapy/formulary/**/*'
- any-glob-to-any-file: '**/formulary/**'

plasmapy.formulary.quantum:
- changed-files:
- any-glob-to-any-file: 'plasmapy/**/quantum*'
- any-glob-to-any-file: '**/quantum*'

plasmapy.particles:
- changed-files:
- any-glob-to-any-file: 'plasmapy/particles/**/*'
- any-glob-to-any-file: [
'**/atomic/**',
'**/particles/**'
]

plasmapy.plasma:
- changed-files:
- any-glob-to-any-file: 'plasmapy/plasma/**/*'
- any-glob-to-any-file: '**/plasma/**'

plasmapy.simulation:
- changed-files:
- any-glob-to-any-file: 'plasmapy/simulation/**/*'
- any-glob-to-any-file: '**/simulation/**'

plasmapy.utils:
- changed-files:
- any-glob-to-any-file: 'plasmapy/utils/**/*'
- any-glob-to-any-file: '**/utils/**'

python:
- changed-files:
- any-glob-to-any-file: '**/*.py'

release:
- changed-files:
- any-glob-to-any-file: [
'.github/workflows/*publish*',
'.github/workflows/*pypi*',
'.github/workflows/*release*'
]

'static type checking':
- changed-files:
- any-glob-to-any-file: [
'**/*mypy*',
'**/py.typed',
'**/type_stubs/**'
]

testing:
- changed-files:
- any-glob-to-any-file: [
'**/test*.py',
'**/*coverage*',
'**/conftest.py',
'.github/workflows/weekly-tests.yml',
'.codecov.yaml',
'**/test*.py',
'**/tests/**',
'*.sh',
'*codecov.y*ml',
'.github/workflows/*tests*.yml',
'.github/workflows/ci.yml',
'noxfile.py',
'pytest.ini',
'tox.ini'
]

tools:
- changed-files:
- any-glob-to-any-file: [
'**/scripts/**',
'**/tools/**'
]
7 changes: 6 additions & 1 deletion .github/workflows/add-no-changelog-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:
});
if (
pullRequest.title.includes('Update pinned requirements') ||
pullRequest.title.includes('autoupdate') ||
pullRequest.title.includes('Minor') ||
pullRequest.title.includes('Fix typo') ||
pullRequest.title.includes('Update changelog entries') ||
pullRequest.title.includes('Update changelog prior to') ||
pullRequest.title.includes('Update pinned requirements') ||
pullRequest.title.includes('Update release checklist') ||
bumpPattern.test(pullRequest.title)
) {
// If yes, then apply the label "No changelog entry needed"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Label PR
# The labels to be added are defined in .github/labeler.yml

on:
- pull_request_target
pull_request_target:
types: [opened, edited, reopened]

jobs:
labeler:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/unlabel-pr-after-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,26 @@ jobs:
if (!pull.data.merged) return;
const labelsToRemove = [
'duplicate',
'effort: high',
'effort: low',
'effort: medium',
'effort: minimal',
'effort: very high',
'good first issue',
'help wanted',
'needed for release',
'needs changelog entry',
'no changelog entry needed',
'perform linkcheck in CI',
'priority: high',
'priority: low',
'priority: medium',
'priority: very high',
'prototype 🏗️',
'Stale',
'status: assigned',
'status: dormant',
'status: in progress',
'status: nearing completion',
'status: on hold',
Expand Down
20 changes: 9 additions & 11 deletions changelog/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pull request to PlasmaPy's ``main`` branch.
* ``feature``: For new user-facing features and any new behavior.
* ``internal``: For refactoring of the internal mechanics of the code
and tests in ways that do not change the application user interface.
* ``removal``: For feature deprecation and/or removal.
* ``removal``: For feature deprecation and planned removals.
* ``trivial``: For minor changes that do not change the application
programming interface.

Expand Down Expand Up @@ -174,7 +174,7 @@ go to the top-level directory of your local clone of PlasmaPy and run:

.. code-block:: shell
pip install -e .[dev]
pip install -e .[docs]
Configuration files for |towncrier| are in :file:`pyproject.toml`.

Expand All @@ -185,16 +185,15 @@ repository. To print out a preview of the changelog, run:
towncrier --draft
To convert the changelog entries into a changelog prior to the 0.7.0
release, run:
To convert the changelog entries into a changelog prior to the
``v2024.5.0`` release, run:

.. code-block:: shell
towncrier --version v0.7.0
towncrier build --version=v2024.5.0
This will create :file:`CHANGELOG.rst` in the top-level directory, with
the option to delete the individual changelog entry files. The full
steps to update the changelog are described in the :ref:`Release Guide`.
This command will ask for permission to delete changelog entries, and
then create :file:`CHANGELOG.rst` in the top-level directory.

.. tip::

Expand All @@ -205,8 +204,7 @@ steps to update the changelog are described in the :ref:`Release Guide`.
towncrier create --edit ⟨number⟩.⟨type⟩.rst
Here, ``⟨number⟩`` is replaced with the pull request number and
``⟨type⟩`` is replaced with the one of the changelog types as
described above.
Replace ``⟨number⟩`` with the pull request number and ``⟨type⟩``
with the one of the changelog types as described above.

.. _inline literal: https://docutils.sourceforge.io/docs/user/rst/quickref.html#inline-markup
1 change: 1 addition & 0 deletions tests/utils/data/test_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def test_get_file_NIST_PSTAR_datafile(downloader_validated) -> None:
assert np.allclose(arr[0, :], np.array([1e-3, 1.043e2]))


@pytest.mark.flaky(reruns=2)
def test_at_most_one_api_call(downloader_validated) -> None:
"""
Test that at most one API call is made over multiple queries
Expand Down

0 comments on commit 3cb0339

Please sign in to comment.