mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-26 13:18:58 +07:00
* WIP tagger session for nox * First pass tagging nox session * Formatting fixup * Adding removal of tmpdir as per discussion * tag session checks for, and uses, existing ansible checkout if it exists, removes tmpdir if it created one. * isort fixup * Working out suggested changes. * Linting cleanup on changes * Different approach to noted chagnes * Reducing tagging session to a bare bones wrapper around the script, leaving all repo management alone * Staging deletion per discussion * Adding tag session to dependency update job * after removing hacking/tagger/requirements.txt moved "gitpython" here for the typing test session requiremnts. * Adding that here didd not accomplish what I'd expected. Removing it and revisiting how to do that. * I think this is where the call needed added to get the tags dependencies automatically updated * remove gitpython, add tag.txt, add blank line * Comment cleanup per OraNod * doc README: document nox tag session instead of manual mode * Update tests/typing.in Per suggestion from @webnjaz Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> --------- Co-authored-by: Maxwell G <maxwell@gtmx.me> Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
This commit is contained in:
1
.github/workflows/pip-compile-dev.yml
vendored
1
.github/workflows/pip-compile-dev.yml
vendored
@@ -39,6 +39,7 @@ jobs:
|
||||
'pip-compile-3.10(typing)'
|
||||
'pip-compile-3.10(static)'
|
||||
'pip-compile-3.10(spelling)'
|
||||
'pip-compile-3.10(tag)'
|
||||
reset-branch: "${{ inputs.reset-branch || false }}"
|
||||
labels: "${{ inputs.labels || 'backport-2.14,backport-2.15,backport-2.16,backport-2.17,tooling' }}"
|
||||
secrets: inherit
|
||||
|
||||
20
README.md
20
README.md
@@ -141,30 +141,22 @@ podman run --rm --tty --volume "$(pwd):/mnt:z" --workdir /mnt docker.io/library/
|
||||
|
||||
When a tag is created in the [`ansible/ansible`](https://github.com/ansible/ansible) repository for a release or release candidate, a corresponding tag should be created in this `ansible-documentation` repository.
|
||||
|
||||
First, install the additional tagging dependencies from this repository as follows, creating or activating a `venv` as needed:
|
||||
|
||||
``` bash
|
||||
python3 -m venv ./venv
|
||||
source ./venv/bin/activate
|
||||
pip install -r hacking/tagger/requirements.txt
|
||||
```
|
||||
|
||||
Next, ensure that you have the [`ansible/ansible`](https://github.com/ansible/ansible) and [`ansible/ansible-documentation`](https://github.com/ansible/ansible-documentation) repositories checked out.
|
||||
First, ensure that you have the [`ansible/ansible`](https://github.com/ansible/ansible) and [`ansible/ansible-documentation`](https://github.com/ansible/ansible-documentation) repositories checked out.
|
||||
The tool assumes that both checkouts have the same parent directory. You can set different paths to your checkouts with the `--docs` and `--core` options if you have them set up another way.
|
||||
|
||||
Lastly, run the tagger script.
|
||||
Next, run the `tag` `nox` session.
|
||||
|
||||
This will determine any missing `ansible-core` tags and create them in `ansible-documentation` if needed, exiting normally otherwise:
|
||||
|
||||
``` bash
|
||||
# The tagger scripts assumes "origin" as the upstream remote.
|
||||
./hacking/tagger/tag.py tag
|
||||
nox -s tag
|
||||
|
||||
# If you use a different upstream remote, specify the name.
|
||||
./hacking/tagger/tag.py --remote <name> tag
|
||||
nox -s tag -- --remote <name> tag
|
||||
|
||||
# If your core repo is not in the same filesystem location, specify the path.
|
||||
./hacking/tagger/tag.py --core <path> tag
|
||||
nox -s tag -- --core <path> tag
|
||||
```
|
||||
|
||||
See `--help` for extended options.
|
||||
See `nox -s tag -- --help` for extended options.
|
||||
|
||||
15
noxfile.py
15
noxfile.py
@@ -180,3 +180,18 @@ def make(session: nox.Session):
|
||||
*(args.make_args or ("clean", "coredocs")),
|
||||
]
|
||||
session.run("make", "-C", "docs/docsite", *make_args, external=True)
|
||||
|
||||
|
||||
@nox.session
|
||||
def tag(session: nox.Session):
|
||||
"""
|
||||
Check the core repo for new releases and create tags in ansible-documentation
|
||||
"""
|
||||
install(session, req="tag")
|
||||
args = list(session.posargs)
|
||||
|
||||
# If run without any arguments, default to "tag"
|
||||
if not any(arg.startswith(("hash", "mantag", "new-tags", "tag")) for arg in args):
|
||||
args.append("tag")
|
||||
|
||||
session.run("python", "hacking/tagger/tag.py", *args)
|
||||
|
||||
30
tests/tag.txt
Normal file
30
tests/tag.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# This file is autogenerated by pip-compile with Python 3.10
|
||||
# by the following command:
|
||||
#
|
||||
# pip-compile --allow-unsafe --output-file=tests/tag.txt --strip-extras tests/tag.in
|
||||
#
|
||||
click==8.1.7
|
||||
# via typer
|
||||
gitdb==4.0.11
|
||||
# via gitpython
|
||||
gitpython==3.1.43
|
||||
# via -r tests/tag.in
|
||||
markdown-it-py==3.0.0
|
||||
# via rich
|
||||
mdurl==0.1.2
|
||||
# via markdown-it-py
|
||||
packaging==24.1
|
||||
# via -r tests/tag.in
|
||||
pygments==2.18.0
|
||||
# via rich
|
||||
rich==13.7.1
|
||||
# via typer
|
||||
shellingham==1.5.4
|
||||
# via typer
|
||||
smmap==5.0.1
|
||||
# via gitdb
|
||||
typer==0.12.3
|
||||
# via -r tests/tag.in
|
||||
typing-extensions==4.12.2
|
||||
# via typer
|
||||
@@ -1,4 +1,4 @@
|
||||
-r ../hacking/pr_labeler/requirements.txt
|
||||
-r ../hacking/tagger/requirements.txt
|
||||
-r tag.in
|
||||
mypy
|
||||
nox
|
||||
|
||||
Reference in New Issue
Block a user