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

Customize changelog section titles #91

Closed
24 tasks done
Tracked by #64
alyssadai opened this issue Dec 15, 2023 · 6 comments
Closed
24 tasks done
Tracked by #64

Customize changelog section titles #91

alyssadai opened this issue Dec 15, 2023 · 6 comments
Assignees

Comments

@alyssadai
Copy link

alyssadai commented Dec 15, 2023

What

In the .autorc file, we should update the change type labels such that:

See https://intuit.github.io/auto/docs/configuration/autorc#adding-additional-changelog-title-sections

Steps to implement

Full configuration of custom PR labels (part of .autorc file)
    {
      "name": "pr-major-breaking",
      "changelogTitle": "💥 Breaking Changes",
      "description": "Significant behaviour change that breaks compatibility, will increment major version (+1.0.0)",
      "releaseType": "major",
      "overwrite": true,
      "color": "#C5000B"
    },
    {
      "name": "pr-minor-breaking",
      "changelogTitle": "💥 Breaking Changes",
      "description": "Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0)",
      "releaseType": "minor",
      "overwrite": true,
      "color": "#F1A60E"
    },
    {
      "name": "pr-minor",
      "changelogTitle": "🚀 Enhancements",
      "description": "Non-breaking feature or enhancement, will increment minor version (0.+1.0)",
      "releaseType": "minor",
      "overwrite": true,
      "color": "#F1A60E"
    },
    {
      "name": "pr-patch",
      "changelogTitle": "🚀 Enhancements",
      "description": "Incremental feature improvement, will increment patch version when merged (0.0.+1)",
      "releaseType": "patch",
      "overwrite": true,
      "default": true,
      "color": "#870048"
    },
    {
      "name": "pr-bug-fix",
      "changelogTitle": "🐛 Bug Fixes",
      "description": "Bug fix, will increment patch version when merged (0.0.+1)",
      "releaseType": "patch",
      "overwrite": true,
      "color": "#870048"
    },
    {
      "name": "pr-documentation",
      "changelogTitle": "📝 Documentation",
      "description": "Change that only affects user documentation",
      "releaseType": "none",
      "overwrite": true,
      "color": "#cfd3d7"
    },
    {
      "name": "pr-tests",
      "changelogTitle": " 🧪 Tests",
      "description": "Add or improve existing tests",
      "releaseType": "none",
      "overwrite": true,
      "color": "#ffd3cc"
    },
    {
      "name": "pr-internal",
      "changelogTitle": "🏠 Internal",
      "description": "Non-user-facing code improvement, will increment patch version when merged (0.0.+1)",
      "releaseType": "patch"
      "overwrite": true,
      "color": "#696969"
    },
    {
      "name": "pr-dependencies",
      "changelogTitle": "🔩 Dependency Updates",
      "description": "Update one or more dependencies version",
      "releaseType": "none",
      "overwrite": true,
      "color": "#8732bc"
    },
    {
      "name": "pr-performance",
      "changelogTitle": "🏎 Performance Improvements",
      "description": "Improve performance of an existing feature, will increment patch version when merged (0.0.+1)",
      "releaseType": "patch",
      "overwrite": true,
      "color": "#f4b2d8"
    },
    {
      "name": "skip-release",
      "description": "PR doesn't appear in the changelog and preserves current version when merged",
      "releaseType": "skip",
      "overwrite": true,
      "color": "#bf5416"
    },
    {
      "name": "release",
      "description": "Create a release when this PR is merged",
      "releaseType": "release",
      "overwrite": true,
      "color": "#007f70"
    }

LABELS TO DELETE:

  1. major
  2. minor
  3. patch
  4. internal
  5. tests
  6. dependencies
  7. performance

@alyssadai:

  • bagel-cli
  • api
  • federation-api
  • digest
  • planning
  • workflows
  • documentation
  • bagelschema
  • project

@rmanaem

  • query-tool
  • annotation_tool
  • react-query-tool
  • neurobagel_examples
  • menu

@surchs:

@alyssadai alyssadai mentioned this issue Dec 15, 2023
29 tasks
@alyssadai alyssadai self-assigned this Jan 12, 2024
@alyssadai
Copy link
Author

@neurobagel/dev, I've assigned each of you repos to delete the leftover PR labels (7 total) from our initial auto setup from.

Please check off the repos when you have finished the deletion :) thanks so much for your help!!

@alyssadai
Copy link
Author

alyssadai commented Jan 12, 2024

FOR REVIEWER:

If all looks good, let me know and I'll wait until all the old PR labels are deleted to close this issue.

@surchs
Copy link
Contributor

surchs commented Jan 12, 2024

Just occured to me:

#!/bin/bash

for repo in $(gh repo list neurobagel --json name | jq -r '.[].name');
do
    for label in major minor patch internal tests dependencies performance;
    do

        gh label delete $label -R neurobagel/$repo --yes
    
    done
done

and so on

@surchs
Copy link
Contributor

surchs commented Jan 13, 2024

Very nice writeup @alyssadai ! docs look good, labels are gone (script may be slightly overzealous in hindsight, it also wiped out all documentation labels ... oh well).

Good to go, I think 🧑‍🍳

@alyssadai
Copy link
Author

alyssadai commented Jan 13, 2024

@surchs the script is a great idea! 💯

You beat me to it - I ended up with the following script (also documented in our internal wiki) to delete labels from repos only if they matched the exact label name, color, and description from a specified list. Aka, the more paranoid version of your script above 😛

I tested it by creating the exact same toy labels in a couple of repos and it seems to work well.

#!/bin/bash

REPOS=$(gh repo list neurobagel --json name | jq -r '.[].name')

# NOTE: the color is case-sensitive in the matching, and should not have # in front of it
LABELS_TO_DELETE=(
	"labelone,c5def5,test label 1"
	"labeltwo,7D939A,test label 2"
)

# NOTE: make sure ${REPOS} doesn't have quotes around it
for repo in ${REPOS}; do
	echo "Processing repository: ${repo}..."

	for label in "${LABELS_TO_DELETE[@]}"; do
		# Get the label attributes
		IFS="," read -r label_name label_color label_description <<< "$label"
		
		# Check if the label exists with the specified name, color, and description
		# NOTE: we set the label limit -L to something pretty big to ensure all existing labels are fetched
		gh label list -R "neurobagel/${repo}" -L 200 --json name,color,description | jq -e ".[] | select(.name == \"$label_name\" and .color == \"$label_color\" and .description == \"$label_description\")" >/dev/null

	if [ $? -eq 0 ]; then
      		gh label delete "$label_name" --repo "neurobagel/${repo}" --yes
    	else
      		echo "Label not found: $label_name"
    	fi
  	done

  	echo -e "Finished processing repository: ${repo}\n"
 done

Also, what did you mean by the following:

script may be slightly overzealous in hindsight, it also wiped out all documentation labels

?

From what I can tell your script doesn't have documentation in the list to delete - how would it have wiped these? 😮

@alyssadai
Copy link
Author

Closing as this is now completed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants