Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implementing ansys/actions/changelogs and adding release note in documentation #3019

Merged
merged 39 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c02f54f
maint: update `labeler.yml`
clatapie Apr 22, 2024
c87d328
feat: implementing `ansys/actions/changelogs`
clatapie Apr 22, 2024
d332d77
Adding changelog entry: 3019.miscellaneous.md
pyansys-ci-bot Apr 22, 2024
70ac8ef
maint: adding `doc-deploy-changelog` action and removing `release.yml…
clatapie Apr 22, 2024
27b9345
maint: adding `update-changelog` as a CICD dependency
clatapie Apr 22, 2024
0cb6e90
fix: `changelog.rst` file
clatapie Apr 23, 2024
21dd02a
revert: readding `release.yml` file
clatapie Apr 23, 2024
f9a03e2
maint: update `labeler.yml`
clatapie Apr 22, 2024
7ac9012
feat: implementing `ansys/actions/changelogs`
clatapie Apr 22, 2024
b64071d
Adding changelog entry: 3019.miscellaneous.md
pyansys-ci-bot Apr 22, 2024
2dce744
maint: adding `doc-deploy-changelog` action and removing `release.yml…
clatapie Apr 22, 2024
8f54f3c
maint: adding `update-changelog` as a CICD dependency
clatapie Apr 22, 2024
7136238
fix: `changelog.rst` file
clatapie Apr 23, 2024
67926bb
revert: readding `release.yml` file
clatapie Apr 23, 2024
a30cf82
Merge branch 'doc/changelog_rst' of https://github.com/ansys/pymapdl …
clatapie Apr 29, 2024
4aecd32
Merge branch 'main' into doc/changelog_rst
clatapie Apr 29, 2024
bf27aee
Update CHANGELOG.md
clatapie Apr 30, 2024
b481121
Merge branch 'main' into doc/changelog_rst
clatapie Apr 30, 2024
8c12558
Merge branch 'main' into doc/changelog_rst
clatapie May 3, 2024
65a8f3f
Merge branch 'main' into doc/changelog_rst
clatapie Jun 4, 2024
57972d2
Merge branch 'doc/changelog_rst' of https://github.com/ansys/pymapdl …
clatapie Jun 4, 2024
4a3b029
maint: adding `branch-name-style` and `commit-style`
clatapie Jun 4, 2024
14f330c
Merge branch 'main' into doc/changelog_rst
clatapie Jun 4, 2024
57f4ae2
Merge branch 'main' into doc/changelog_rst
clatapie Jun 5, 2024
e4f8ae8
Adding pull request template
germa89 Jun 11, 2024
545cd60
Update pyproject.toml
clatapie Jun 11, 2024
0e51264
Merge branch 'main' into doc/changelog_rst
clatapie Jun 11, 2024
65400b2
doc: adding branch and commit naming convention references
clatapie Jun 13, 2024
24c950c
Merge branch 'doc/changelog_rst' of https://github.com/ansys/pymapdl …
clatapie Jun 13, 2024
57b9ae7
doc: adding the mention of the *PyAnsys Developer's Guide* before red…
clatapie Jun 13, 2024
368377c
Merge branch 'main' into doc/changelog_rst
clatapie Jun 14, 2024
423537a
Apply suggestions from code review
clatapie Jun 17, 2024
d368f41
doc: removing unused practice
clatapie Jun 17, 2024
9e15edd
maint: removing `Testing` label in `labeler.yml`
clatapie Jun 17, 2024
93befb0
Merge branch 'doc/changelog_rst' of https://github.com/ansys/pymapdl …
clatapie Jun 17, 2024
3655639
doc: redirecting to PyAnsys dev guide
clatapie Jun 17, 2024
de9a10d
Update .github/pull_request_template.md
clatapie Jun 18, 2024
0e27a4f
fix: updating `dependabot.yml` file
clatapie Jun 18, 2024
7ada8b1
Merge branch 'main' into doc/changelog_rst
clatapie Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Description
**Please provide a brief description of the changes made in this pull request.**

## Issue linked
**Please mention the issue number or describe the problem this pull request addresses.**

## Checklist
clatapie marked this conversation as resolved.
Show resolved Hide resolved
- [ ] I have visited and read [Develop PyMAPDL](https://mapdl.docs.pyansys.com/version/stable/getting_started/develop_pymapdl.html#develop-pymapdl).
- [ ] I have [tested my changes locally](https://mapdl.docs.pyansys.com/version/stable/getting_started/develop_pymapdl.html#unit-testing)
- [ ] I have added necessary [documentation or updated existing documentation](https://mapdl.docs.pyansys.com/version/stable/getting_started/write_documentation.html#id2).
- [ ] I have followed the [PyMAPDL coding style guidelines](https://mapdl.docs.pyansys.com/version/stable/getting_started/develop_pymapdl.html#code-style).
- [ ] I have added appropriate [unit tests](https://mapdl.docs.pyansys.com/version/stable/getting_started/develop_pymapdl.html#unit-testing) that also ensure the [minimal coverage criteria](https://mapdl.docs.pyansys.com/version/stable/getting_started/develop_pymapdl.html#code-coverage).
- [ ] I have reviewed my changes before submitting this pull request.
- [ ] I have [linked the issue or issues](https://dev.docs.pyansys.com/content-writing/content-how-tos/create-PR.html#id2) that are solved to the PR if any.
- [ ] I have [assigned this PR to myself](https://dev.docs.pyansys.com/content-writing/content-how-tos/create-PR.html#id2).
- [ ] I have made sure that the title of my PR follows [Commit naming conventions](https://dev.docs.pyansys.com/how-to/contributing.html#commit-naming-conventions) (e.g. ``feat: adding new MAPDL command``)
clatapie marked this conversation as resolved.
Show resolved Hide resolved
38 changes: 37 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,41 @@ permissions:

jobs:


update-changelog:
name: "Update CHANGELOG (on release)"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: ansys/actions/doc-deploy-changelog@v6
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}


branch-name:
# Only if the event is a pull request and the branch name is not from the pre-commit-ci bot
if: github.event_name == 'pull_request' && github.head_ref != 'pre-commit-ci-update-config'
name: Check the name of the branch
runs-on: ubuntu-latest
steps:
- name: Check branch name
uses: ansys/actions/branch-name-style@v6


commit-name:
if: github.event_name == 'pull_request'
name: Check the name of the commit
runs-on: ubuntu-latest
steps:
- name: Check commit name
uses: ansys/actions/commit-style@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}


doc-style:
name: "Documentation style check"
runs-on: ubuntu-latest
Expand All @@ -69,6 +104,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
vale-version: "3.4.1"


smoke-tests:
name: Build and smoke test (${{ matrix.os }} | Python ${{ matrix.python-version }}) (Release=${{ matrix.should-release }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -816,7 +852,7 @@ jobs:
release:
name: "Release"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [smoke-tests, docs-build, build-test, build-test-ubuntu, build-test-ubuntu-minimal]
needs: [smoke-tests, docs-build, build-test, build-test-ubuntu, build-test-ubuntu-minimal, update-changelog]
runs-on: ubuntu-latest
steps:
- name: Set up Python
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: "Pull Request Labeler"
on:
pull_request:
types: [opened, reopened]
# opened, reopened, and synchronize are default for pull_request
# edited - when PR title or body is changed
# labeled - when labels are added to PR
types: [opened, reopened, synchronize, edited, labeled]
push:
branches: [ main ]
paths:
Expand Down Expand Up @@ -101,3 +104,15 @@ jobs:
- [Examples](https://github.com/ansys/pymapdl/pulls?q=label%3Aexamples+)
- [Maintenance](https://github.com/ansys/pymapdl/pulls?q=label%3Amaintenance+)
- [CI/CD](https://github.com/ansys/pymapdl/pulls?q=label%3Aci%2Fcd+)

changelog-fragment:
name: "Create changelog fragment"
needs: [labeler]
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-changelog@v6
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG

This project uses [towncrier](https://towncrier.readthedocs.io/) to generate changelogs.

For more information, see the [raw release notes](doc/source/changelog.rst).

[Published release notes](https://mapdl.docs.pyansys.com/version/stable/changelog.html) can be found in the online documentation.
1 change: 1 addition & 0 deletions doc/changelog.d/3019.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: implementing `ansys/actions/changelogs` and adding release note in documentation
17 changes: 17 additions & 0 deletions doc/changelog.d/changelog_template.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if sections[""] %}
{% for category, val in definitions.items() if category in sections[""] %}

{{ definitions[category]['name'] }}
{% set underline = '^' * definitions[category]['name']|length %}
{{ underline }}

{% for text, values in sections[""][category].items() %}
- {{ text }} {{ values|join(', ') }}
{% endfor %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
13 changes: 13 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _ref_release_notes:

Release notes
#############

This document contains the release notes for the project.

.. vale off

.. towncrier release notes start


.. vale on
12 changes: 10 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
# The short X.Y version
release = version = __version__
cname = os.getenv("DOCUMENTATION_CNAME", "mapdl.docs.pyansys.com")
switcher_version = get_version_match(__version__)

REPOSITORY_NAME = "pymapdl"
USERNAME = "ansys"
Expand Down Expand Up @@ -229,6 +230,13 @@
"pyvista.Plotter.show",
]

# If we are on a release, we have to ignore the "release" URLs, since it is not
# available until the release is published.
if switcher_version != "dev":
linkcheck_ignore.append(
f"https://github.com/ansys/pymapdl/releases/tag/v{__version__}"
)

user_agent = """curl https://www.ansys.com -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.3"""

# The name of the Pygments (syntax highlighting) style to use.
Expand Down Expand Up @@ -299,12 +307,12 @@
],
"switcher": {
"json_url": f"https://{cname}/versions.json",
"version_match": get_version_match(__version__),
"version_match": switcher_version,
},
"use_meilisearch": {
"api_key": os.getenv("MEILISEARCH_PUBLIC_API_KEY", ""),
"index_uids": {
f"pymapdl-v{get_version_match(__version__).replace('.', '-')}": "PyMAPDL",
f"pymapdl-v{switcher_version.replace('.', '-')}": "PyMAPDL",
},
},
}
Expand Down
7 changes: 6 additions & 1 deletion doc/source/getting_started/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ Overall guidance on contributing to a PyAnsys library appears in the
in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
with it and the `Coding style <dev_guide_coding_style_>`_ before attempting to
contribute to PyMAPDL.


In order to have a nice :ref:`ref_release_notes` section, it is important to follow
the branch and commit names conventions as described in the *PyAnsys Developer's Guide*
`branch <dev_guide_branch_names_>`_ and `commit <dev_guide_commit_names_>`_ naming
sections.


Answer discussions
==================
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
mapdl_commands/index
api/index
examples/index
changelog


.. image:: ../source/_static/logo_dark.png
Expand Down
2 changes: 2 additions & 0 deletions doc/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
.. _dev_guide_contributing: https://dev.docs.pyansys.com/how-to/contributing.html
.. _dev_guide_coding_style: https://dev.docs.pyansys.com/coding-style/index.html
.. _dev_guide_setup_your_environment: https://dev.docs.pyansys.com/how-to/setting-up.html
.. _dev_guide_branch_names: https://dev.docs.pyansys.com/how-to/contributing.html#branch-naming-conventions
.. _dev_guide_commit_names: https://dev.docs.pyansys.com/how-to/contributing.html#commit-naming-conventions

.. #Other libraries
.. _pyvista_docs: https://docs.pyvista.org/version/stable/
Expand Down
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,37 @@ override_SS05 = [ # override SS05 to allow docstrings starting with these words
# '^Assess ',
# '^Access ',
]

[tool.towncrier]
package = "ansys.mapdl.core"
directory = "doc/changelog.d"
filename = "doc/source/changelog.rst"
template = "doc/changelog.d/changelog_template.jinja"
start_string = ".. towncrier release notes start\n"
title_format = "`{version} <https://github.com/ansys/pymapdl/releases/tag/v{version}>`_ - {project_date}"
issue_format = "`#{issue} <https://github.com/ansys/pymapdl/pull/{issue}>`_"

[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true

[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true

[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true

[[tool.towncrier.type]]
directory = "dependencies"
name = "Dependencies"
showcontent = true

[[tool.towncrier.type]]
directory = "miscellaneous"
name = "Miscellaneous"
showcontent = true
Loading