Skip to content

Commit

Permalink
docs: documenting new naming conventions for commits, branches and PR…
Browse files Browse the repository at this point in the history
…s. (#3228)

* docs: documenting new naming conventions for commits, branches and PRs.

* Adding changelog entry: 3228.miscellaneous.md

* docs: Adding word exceptions.

* feat: labeler uses now the pull request name instead of the branch name.

* feat: harmonizing labels

* feat: improving changed files rules.

* doc: documenting automatically labelling

* chore: adding changelog file 3228.changed.md

* Apply suggestions from code review

Co-authored-by: Kathy Pippert <[email protected]>

* fix: vale issue

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: Maxime Rey <[email protected]>
  • Loading branch information
4 people authored Jul 1, 2024
1 parent cda716a commit c386f0c
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 41 deletions.
16 changes: 10 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
Documentation:
documentation:
- changed-files:
- any-glob-to-any-file: ['doc/source/**/*', 'examples/**/*']
- any-glob-to-any-file: ['doc/source/**/*', 'examples/**/*', 'doc/styles/**/*']

Maintenance:
examples:
- changed-files:
- any-glob-to-any-file: ['.github/**/*', 'codecov.yml', '.flake8', '.coveragerc', 'ignore_words.txt', 'pyproject.toml']
- any-glob-to-any-file: ['examples/**/*']

Dependencies:
maintenance:
- changed-files:
- any-glob-to-any-file: ['.github/**/*', 'codecov.yml', '.flake8', '.coveragerc', 'ignore_words.txt', 'pyproject.toml', '.devcontainer/**/requirements.txt', 'doc/make.bat', 'doc/Makefile', minimum_requirements.txt]

dependencies:
- changed-files:
- any-glob-to-any-file: ['pyproject.toml']

CI/CD:
- changed-files:
- any-glob-to-any-file: ['docker/**/*', '.github/**/*', '.ci/**/*']
- any-glob-to-any-file: ['docker/**/*', '.github/**/*', '.ci/**/*', '.devcontainer/**/*']
26 changes: 13 additions & 13 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@
description: "No further development until this is fixed"
color: C0392B

- name: Critical Priority
- name: critical priority
description: "This issue affects almost all users"
color: E67E22

- name: Major Priority
- name: major priority
description: "This issue affects some users"
color: F4D03F

- name: Minor Priority
description: "It does not affect almost any users"
- name: minor priority
description: "This issue affects few users"
color: F9E79F

- name: Future
- name: future
description: "To work on it in the future, since it can be delayed"
color: 27AE60

- name: Won't fix
- name: won't fix
description: "For different reasons, this won't be fixed"
color: ffffff

Expand Down Expand Up @@ -102,23 +102,23 @@
# Issue management
# ================

- name: Duplicate
- name: duplicate
description: "Duplicated issue"
color: E67E22

- name: Good First Issue
- name: good first issue
description: "Best way to start working on PyMAPDL development"
color: 27AE60

- name: Help wanted!
- name: help wanted!
description: "Tell the developers you need help or guidance"
color: F4D03F

- name: Stale
description: "Stale issue, it will be closed soon"
- name: stale
description: "Stale issue likely to be closed soon"
color: E67E22

- name: Waiting doc review
- name: waiting doc review
description: "This PR is waiting for its documentation to be reviewed."
color: 27AE60

Expand Down Expand Up @@ -147,6 +147,6 @@
description: "Related to the reminder bot"
color: ffffff

- name: Build failed
- name: build failed
description: "Schedule build fails"
color: E67E22
46 changes: 30 additions & 16 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,42 +45,56 @@ jobs:
# Label based on branch name
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'doc') ||
startsWith(github.event.pull_request.head.ref, 'docs')
startsWith(github.event.pull_request.title, 'fix') ||
startsWith(github.event.pull_request.title, 'bug') ||
startsWith(github.event.pull_request.title, 'patch')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: documentation
labels: bug

- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'docker') ||
startsWith(github.event.pull_request.head.ref, 'no-ci') ||
startsWith(github.event.pull_request.head.ref, 'ci')
startsWith(github.event.pull_request.title, 'feat')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: CI/CD
labels: new feature

- uses: actions-ecosystem/action-add-labels@v1
if: startsWith(github.event.pull_request.head.ref, 'maint')
if: |
startsWith(github.event.pull_request.title, 'style') ||
startsWith(github.event.pull_request.title, 'refactor') ||
startsWith(github.event.pull_request.title, 'perf') ||
startsWith(github.event.pull_request.title, 'test') ||
startsWith(github.event.pull_request.title, 'chore')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: maintenance
labels: enhancement

- uses: actions-ecosystem/action-add-labels@v1
if: startsWith(github.event.pull_request.head.ref, 'feat')
if: |
startsWith(github.event.pull_request.title, 'build') ||
startsWith(github.event.pull_request.title, 'revert') ||
startsWith(github.event.pull_request.title, 'maint')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: maintenance

- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.title, 'doc') ||
startsWith(github.event.pull_request.title, 'docs')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: |
enhancement
new feature
labels: documentation

- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'fix') ||
startsWith(github.event.pull_request.head.ref, 'patch')
startsWith(github.event.pull_request.title, 'docker') ||
startsWith(github.event.pull_request.title, 'no-ci') ||
startsWith(github.event.pull_request.title, 'ci')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: bug
labels: CI/CD

commenter:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/3228.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs: documenting new naming conventions for commits, branches and PRs.
46 changes: 45 additions & 1 deletion doc/source/getting_started/develop_pymapdl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,37 @@ guidelines for developing code in a repository:

#. **Use branches**: Create branches for different features, bug fixes, or
experiments. This keeps changes isolated and facilitates parallel
development.
development. The CI/CD checks that the branch name is compliant. For example,
the branch name must start with a prefix and a backslash.
The allowed prefixes are:

- `fix/` - Bug fixes.
- `feat/` - Changes that introduce a new feature or significant addition.
- `maint/` - General maintenance of the repository. For instance, improving the CI/CD workflows.
- `docs/` - Improves documentation and examples.
- `no-ci/` - (Not applicable to PyMAPDL) In some repositories, branches with this prefix do not trigger CI/CD.
- `test/` - Improvements or changes to testing.
- `testing/` - For testing and debugging. It should not be used for branches that are going to be merged to ``main``.
- `release/` - Contains the released versions changes.
- `dependabot/` - Created by Dependabot.
- `junk/` - Other purposes. It should not be used for branches that are going to be merged to ``main``.

#. **Write descriptive commit messages**: Provide clear and concise commit
messages that explain the purpose and context of the changes. Follow a
consistent style.

- `fix:` - Bug fixes.
- `feat:` - Changes that introduce a new feature or significant addition.
- `docs:` - Changes pertaining only to documentation.
- `style:` - Changes that do not affect the meaning of the code (such as white space, formatting, and missing semicolons).
- `refactor:` - A code change that neither fixes a bug nor adds a feature.
- `perf:` - A code change that improves performance.
- `test:` - Improvements or changes to testing.
- `build:` - Changes that affect the build system or external dependencies (such as to ``pip`` or ``make``).
- `ci:` - Changes to the CI/CD configuration files and scripts.
- `chore:` - Other changes that don't modify the code (such as releasing and versioning).
- `revert:` - Reverts a previous commit.

#. **Commit frequently**: Make small, meaningful commits frequently. Avoid
making a large number of unrelated changes in a single commit.

Expand All @@ -77,6 +102,25 @@ guidelines for developing code in a repository:

#. **Use pull requests (PRs)**: Use PRs to submit your changes for review.
This allows for discussion and validation before merging into the main branch.
Pull requests must follow the same convention as the commit messages.
The following prefixes are allowed in the pull request names:

- `fix:` - Bug fixes.
- `feat:` - Changes that introduce a new feature or significant addition.
- `docs:` - Changes pertaining only to documentation.
- `style:` - Changes that do not affect the meaning of the code (such as white space, formatting, and missing semicolons).
- `refactor:` - A code change that neither fixes a bug nor adds a feature.
- `perf:` - A code change that improves performance.
- `test:` - Improvements or changes to testing.
- `build:` - Changes that affect the build system or external dependencies (such as to ``pip`` or ``make``).
- `ci:` - Changes to the CI/CD configuration files and scripts.
- `chore:` - Other changes that don't modify the code (such as releasing and versioning).
- `revert:` - Reverts a previous pull request.

The pull requests can also be labeled for easier repository maintenance.
The CI/CD automatically labels each pull request based on the pull requests prefix and
the modified files, but you can also add extra labels as long as they are already defined
in the repository.

#. **Write good documentation**: Maintain clear and up-to-date documentation for your
contribution or changes, including comments in code, and relevant project
Expand Down
13 changes: 8 additions & 5 deletions doc/styles/config/vocabularies/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ appen
Apple Silicon
argparse
Arruda-Boyce
askin
BCs
Block Lanzos
Boyce
Expand All @@ -50,9 +51,11 @@ centerline
CentOS
CentOS7
Chao
ci
container_layout
datas
delet
Dependabot
Dev
devcontainer
DevContainer
Expand All @@ -77,6 +80,7 @@ Gmsh
GPa
GPUs
GUI
Hashin
hexahedral
hostname
HTML
Expand Down Expand Up @@ -115,6 +119,7 @@ NumPy
onefile
optiSLang
parm
perf
performant
PMLs
POIN
Expand Down Expand Up @@ -154,6 +159,7 @@ sur
tablet
thermomechanical
thermomechanically
THIRDPARTY
thispagetitle
Tool-Narayanaswamy
tread
Expand All @@ -173,12 +179,9 @@ von
VTK
wan
WAN
WHIT
Windows Subsystem
Windows Subsystem for Linux
wsl
WSL
Zhu
THIRDPARTY
askin
Hashin
WHIT
Zhu

0 comments on commit c386f0c

Please sign in to comment.