diff --git a/README.md b/README.md index e370e025..5dd2155d 100644 --- a/README.md +++ b/README.md @@ -85,10 +85,6 @@ The following settings are stored in `template_config.yml`. github_org The Github organization to use for the plugin. - issue_tracker Which issue tracker the project will use. Valid values are 'redmine' and - 'github'. To switch from Redmine to GitHub use the --migrate-github-issues - option. - latest_release_branch A pointer to the currently latest release branch (this is automatically updated). @@ -151,7 +147,7 @@ The following settings are stored in `template_config.yml`. supported_release_branches Specify the release branches that should receive regular CI updates. - sync_ci Enables a nightly workflow to update the CI files. + sync_ci Enables a weekly workflow to update the CI files. test_cli Run the pulp-cli tests as part of the CI tests @@ -159,11 +155,6 @@ The following settings are stored in `template_config.yml`. list, a separate job will run a specific performance test file for each entry in the list. Otherwise, all performance tests will be run together. - test_released_plugin_with_next_pulpcore_release - Include a cron job that tests the latest released version of the plugin to - see if it is compatible with pulpcore's main branch. This helps ensure - that pulpcore is following the deprecation policy for the plugin API. - disabled_redis_runners A list of test runners that should have the Redis service disabled. By default, all runners execute tests with the Redis service enabled. The list diff --git a/ci-structure.dot b/ci-structure.dot index e056d02d..a0707d89 100644 --- a/ci-structure.dot +++ b/ci-structure.dot @@ -12,9 +12,10 @@ digraph "Pulp CI" { label="CI Jobs" lint [shape=box] - prerelease [shape=box label="prerelease checks"] + docs [shape=box] + prerelease [shape=box, label="prerelease checks (idea)"] build [shape=box, label="build wheel"] - build2 [shape=box label="build docs & bindings"] + build2 [shape=box, label="build bindings"] tests [shape=box3d] { rank=same @@ -22,6 +23,7 @@ digraph "Pulp CI" { deprecations [shape=box] publish [shape=box] } + ready [shape=box, label="ready to ship"] } { @@ -29,43 +31,39 @@ digraph "Pulp CI" { PyPi [shape=parallelogram] rubygems [shape=parallelogram] - ppo [shape=parallelogram label="pulpproject.org"] } subgraph cluster_built { label="Build Artifacts" - wheel -> apidoc -> { - bindings - docs - } + wheel -> apidoc -> bindings } git -> lint [label="PR"] + git -> docs [label="PR"] git -> build [label="nightly"] git -> prerelease [label="tag"] {lint prerelease} -> build -> build2 build2 -> tests [label="PR"] build2 -> publish [label="Release"] tests -> deprecations + {tests docs} -> ready { edge [style=dotted] publish -> PyPi publish -> rubygems - publish -> ppo } { edge [style=dashed] - base -> {build2 tests} + base -> tests build -> wheel - build2 -> {apidoc bindings docs} + build2 -> {apidoc bindings} wheel -> {tests build2 publish} bindings -> {tests publish} - docs -> publish } } diff --git a/plugin-template b/plugin-template index f3bf8c20..84ec91bf 100755 --- a/plugin-template +++ b/plugin-template @@ -37,7 +37,6 @@ DEFAULT_SETTINGS = { "flake8_ignore": [], "flake8": True, "github_org": "pulp", - "issue_tracker": "github", "latest_release_branch": None, "lint_requirements": True, "noissue_marker": "[noissue]", diff --git a/requirements.txt b/requirements.txt index dcab5d44..12e2b14d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ +jinja2 +pyyaml requests~=2.32.3 diff --git a/templates/bootstrap/.gitignore.j2 b/templates/bootstrap/.gitignore.j2 index d4cd1996..c53976d3 100644 --- a/templates/bootstrap/.gitignore.j2 +++ b/templates/bootstrap/.gitignore.j2 @@ -57,25 +57,12 @@ coverage.xml local_settings.py db.sqlite3 -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - # PyBuilder target/ -# Jupyter Notebook -.ipynb_checkpoints - # pyenv .python-version -# SageMath parsed files -*.sage.py - # Environments .env .venv @@ -85,20 +72,8 @@ ENV/ env.bak/ venv.bak/ -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - # mkdocs documentation /site # mypy .mypy_cache/ - -# Editors -.vscode/ -.idea/ - diff --git a/templates/bootstrap/README.md.j2 b/templates/bootstrap/README.md.j2 index 6176c254..e75530a8 100644 --- a/templates/bootstrap/README.md.j2 +++ b/templates/bootstrap/README.md.j2 @@ -8,8 +8,6 @@ For more information, please see the [documentation](docs/index.md) or the [Pulp How to File an Issue -------------------- -{% if issue_tracker == 'github' %} File through this project's GitHub issues and appropriate labels. -{% endif %} > **WARNING** Is this security related? If so, please follow the [Security Disclosures](https://docs.pulpproject.org/pulpcore/bugs-features.html#security-bugs) procedure. diff --git a/templates/bootstrap/pyproject.toml.j2 b/templates/bootstrap/pyproject.toml.j2 index ae0b316f..fbb46772 100644 --- a/templates/bootstrap/pyproject.toml.j2 +++ b/templates/bootstrap/pyproject.toml.j2 @@ -11,9 +11,7 @@ filename = "CHANGES.md" directory = "CHANGES/" title_format = "## {version} ({project_date}) {% raw %}{{: #{version} }}{% endraw %}" template = "CHANGES/.TEMPLATE.md" -{% if issue_tracker == 'github' %} issue_format = "[#{issue}](https://github.com/pulp/{{ plugin_name }}/issues/{issue})" -{% endif %} start_string = "[//]: # (towncrier release notes start)\n" underlines = ["", "", ""] diff --git a/templates/github/.ci/scripts/validate_commit_message.py.j2 b/templates/github/.ci/scripts/validate_commit_message.py.j2 index 7c1033a9..34936588 100644 --- a/templates/github/.ci/scripts/validate_commit_message.py.j2 +++ b/templates/github/.ci/scripts/validate_commit_message.py.j2 @@ -4,21 +4,17 @@ import re import sys from pathlib import Path import subprocess -{% if issue_tracker == 'github' %} - import os import warnings from github import Github -{% endif %} NO_ISSUE = "[noissue]" CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc", ".deprecation"] +KEYWORDS = ["fixes", "closes"] + sha = sys.argv[1] message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8") -{% if issue_tracker == 'github' %} -KEYWORDS = ["fixes", "closes"] - g = Github(os.environ.get("GITHUB_TOKEN")) repo = g.get_repo("pulp/{{ plugin_name }}") @@ -33,13 +29,7 @@ def __check_status(issue): "'(cherry picked from commit ...)' to the original commit message." ) sys.exit(f"Error: issue #{issue} is closed.") -{% else %} -KEYWORDS = [] - -def __check_status(issue): - pass -{% endif %} def __check_changelog(issue): matches = list(Path("CHANGES").rglob(f"{issue}.*")) diff --git a/templates/github/.github/workflows/create-branch.yml.j2 b/templates/github/.github/workflows/create-branch.yml.j2 index 60b9ce16..80928cbf 100644 --- a/templates/github/.github/workflows/create-branch.yml.j2 +++ b/templates/github/.github/workflows/create-branch.yml.j2 @@ -23,9 +23,11 @@ jobs: steps: {{ checkout(depth=0, path=plugin_name) | indent(6) }} + {{ checkout(repository="pulp/plugin_template", path="plugin_template") | indent(6) }} + {{ setup_python() | indent(6) }} - {{ install_python_deps(["bump2version", "jinja2", "pyyaml", "packaging", "requests"]) | indent(6) }} + {{ install_python_deps(["bump2version", "packaging", "-r", "plugin_template/requirements.txt"]) | indent(6) }} {{ set_secrets(path=plugin_name) | indent(6) }} @@ -57,13 +59,6 @@ jobs: run: | find CHANGES -type f -regex ".*\.\(bugfix\|doc\|feature\|misc\|deprecation\|removal\)" -exec git rm {} + - - name: Checkout plugin template - uses: actions/checkout@v4 - with: - repository: pulp/plugin_template - path: plugin_template - fetch-depth: 0 - - name: Update CI branches in template_config working-directory: plugin_template run: | diff --git a/templates/github/.github/workflows/scripts/install.sh.j2 b/templates/github/.github/workflows/scripts/install.sh.j2 index 378b98a1..e0dfa3a0 100755 --- a/templates/github/.github/workflows/scripts/install.sh.j2 +++ b/templates/github/.github/workflows/scripts/install.sh.j2 @@ -16,16 +16,12 @@ PLUGIN_SOURCE="./{{ plugin_name }}/dist/{{ plugin_name | snake }}-${PLUGIN_VERSI export PULP_API_ROOT="{{ api_root }}" PIP_REQUIREMENTS=("{{ cli_package }}") -{%- if plugin_name == 'pulpcore' %} -if [[ "$TEST" = "publish" ]] -then - PIP_REQUIREMENTS+=("psycopg2-binary") -fi -{%- endif %} +# This must be the **only** call to "pip install" on the test runner. pip install ${PIP_REQUIREMENTS[*]} {% if test_cli -%} +# Check out the {{ cli_package }} branch matching the installed version. PULP_CLI_VERSION="$(pip freeze | sed -n -e 's/{{ cli_package }}==//p')" git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_package }} {%- endif %} diff --git a/templates/github/.github/workflows/update_ci.yml.j2 b/templates/github/.github/workflows/update_ci.yml.j2 index e33d1a1d..400e97ae 100644 --- a/templates/github/.github/workflows/update_ci.yml.j2 +++ b/templates/github/.github/workflows/update_ci.yml.j2 @@ -29,7 +29,7 @@ jobs: {{ setup_python() | indent(6) }} - {{ install_python_deps(["gitpython", "requests", "packaging", "jinja2", "pyyaml"]) | indent(6) }} + {{ install_python_deps(["gitpython", "packaging", "-r", "plugin_template/requirements.txt"]) | indent(6) }} {{ configure_git() | indent(6) }}