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

Cleanup #905

Merged
merged 6 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -151,19 +147,14 @@ 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

test_performance Include a nightly job that runs a script to test performance. If using a
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
Expand Down
20 changes: 9 additions & 11 deletions ci-structure.dot
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,58 @@ 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

deprecations [shape=box]
publish [shape=box]
}
ready [shape=box, label="ready to ship"]
}

{
rank=sink

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
}
}
1 change: 0 additions & 1 deletion plugin-template
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
jinja2
pyyaml
requests~=2.32.3
25 changes: 0 additions & 25 deletions templates/bootstrap/.gitignore.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/

2 changes: 0 additions & 2 deletions templates/bootstrap/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 0 additions & 2 deletions templates/bootstrap/pyproject.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["", "", ""]

Expand Down
14 changes: 2 additions & 12 deletions templates/github/.ci/scripts/validate_commit_message.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}")

Expand All @@ -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}.*"))
Expand Down
11 changes: 3 additions & 8 deletions templates/github/.github/workflows/create-branch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}

Expand Down Expand Up @@ -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: |
Expand Down
8 changes: 2 additions & 6 deletions templates/github/.github/workflows/scripts/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/update_ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}

Expand Down
Loading