Skip to content

Commit

Permalink
WIP Remove [noissue] mechanics
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Sep 6, 2024
1 parent 8832225 commit 46b3007
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .ci/bootstrap_catdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ "$GITHUB_EVENT_NAME" = "pull_request" ]
then
COMMIT_MSG=$(git log --format=%B -n 1 HEAD^2)
else
COMMIT_MSG="Initial commit\n\n[noissue]"
COMMIT_MSG="Initial commit"
fi
echo "${COMMIT_MSG}"

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ The following settings are stored in `template_config.yml`.
the CI will run an additional pytest call running pulpcore tests with that
mark.

noissue_marker A string that is used to mark a commit as not attached to an issue.

stalebot A boolean that indicates whether to use stalebot or not.

stalebot_days_until_stale
Expand Down
1 change: 0 additions & 1 deletion plugin-template
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ DEFAULT_SETTINGS = {
"github_org": "pulp",
"latest_release_branch": None,
"lint_requirements": True,
"noissue_marker": "[noissue]",
"os_required_packages": [],
"parallel_test_workers": 8,
"plugin_app_label": None,
Expand Down
11 changes: 3 additions & 8 deletions scripts/update_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@ fi

plugin_name="$(python ../plugin_template/scripts/get_template_config_value.py plugin_name)"
ci_update_docs="$(python ../plugin_template/scripts/get_template_config_value.py ci_update_docs)"
noissue_marker="$(python ../plugin_template/scripts/get_template_config_value.py noissue_marker)"
use_black="$(python ../plugin_template/scripts/get_template_config_value.py black)"

if [[ -z "${noissue_marker}" ]]; then
noissue_marker="[noissue]"
fi

if [[ "${ci_update_docs}" == "True" ]]; then
docs=("--docs")
else
Expand All @@ -46,7 +41,7 @@ fi

if [[ $(git status --porcelain) ]]; then
git add -A
git commit -m "Update CI files" -m "${noissue_marker}"
git commit -m "Update CI files"
else
echo "No updates needed"
fi
Expand All @@ -59,7 +54,7 @@ then
if [[ "$(git status --porcelain)" ]]
then
git add -A
git commit -m "Reformat with black" -m "${noissue_marker}"
git commit -m "Reformat with black"
else
echo "No formatting change needed"
fi
Expand All @@ -70,6 +65,6 @@ if [[ "$plugin_name" != "pulpcore" ]]; then
python ../plugin_template/scripts/update_core_lowerbound.py
if [[ $(git status --porcelain) ]]; then
git add -A
git commit -m "Bump pulpcore lowerbounds to supported branch" -m "$noissue_marker"
git commit -m "Bump pulpcore lowerbounds to supported branch"
fi
fi
2 changes: 1 addition & 1 deletion templates/github/.ci/scripts/collect_changes.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def main():
for change in main_changes:
fp.write(change[1])

repo.git.commit("-m", "Update Changelog", "-m" "{{ noissue_marker | default("[noissue]") }}", CHANGELOG_FILE)
repo.git.commit("-m", "Update Changelog", CHANGELOG_FILE)


if __name__ == "__main__":
Expand Down
11 changes: 0 additions & 11 deletions templates/github/.ci/scripts/validate_commit_message.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import os
import warnings
from github import Github

NO_ISSUE = "[noissue]"
CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc", ".deprecation"]
KEYWORDS = ["fixes", "closes"]

Expand Down Expand Up @@ -55,15 +54,5 @@ if issues:
for issue in pattern.findall(message):
__check_status(issue)
__check_changelog(issue)
else:
if NO_ISSUE in message:
print("Commit {sha} has no issues but is tagged {tag}.".format(sha=sha[0:7], tag=NO_ISSUE))
elif "Merge" in message and "cherry picked from commit" in message:
pass
else:
sys.exit(
"Error: no attached issues found for {sha}. If this was intentional, add "
" '{tag}' to the commit message.".format(sha=sha[0:7], tag=NO_ISSUE)
)

print("Commit message for {sha} passed.".format(sha=sha[0:7]))
2 changes: 0 additions & 2 deletions templates/github/.github/workflows/create-branch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ jobs:
branch: minor-version-bump
base: {{ plugin_default_branch }}
title: Bump minor version
body: '[noissue]'
commit-message: |
Bump minor version
[noissue]
delete-branch: true

- name: Push release branch
Expand Down
6 changes: 1 addition & 5 deletions templates/github/.github/workflows/update_ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ jobs:
committer: "{{ release_user }} <{{ release_email }}>"
author: "{{ release_user }} <{{ release_email }}>"
title: "Update CI files for branch {{ branch }}"
body: ""
branch: "update-ci/{{ branch }}"
base: "{{ branch }}"
commit-message: |
Update CI files

{{ noissue_marker }}
delete-branch: true
{%- endfor %}
...

0 comments on commit 46b3007

Please sign in to comment.