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

.github: set link for GH issue feature template #17214

Merged
merged 1 commit into from Sep 8, 2021

Conversation

aanm
Copy link
Member

@aanm aanm commented Aug 23, 2021

To check for backport PRs we should check the label backport/1.X.

Signed-off-by: André Martins andre@cilium.io

To check for backport PRs we should check the label backport/1.X.

Signed-off-by: André Martins <andre@cilium.io>
@aanm aanm requested a review from joestringer August 23, 2021 09:56
@aanm aanm requested a review from a team as a code owner August 23, 2021 09:56
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 23, 2021
@aanm aanm added the release-note/misc This PR makes changes that have no direct user impact. label Aug 23, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 23, 2021
Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the "backports" keyword search not work?

Originally I avoided setting it like is proposed here because label:backport/1.X is guaranteed to link to an empty result, and we typically do releases for multiple branches at the same time so it doesn't matter if the filter catches more than the specific branch.

That said, if this works better for you then I'm OK with merging it.

@aanm
Copy link
Member Author

aanm commented Aug 24, 2021

Does the "backports" keyword search not work?

No, look at the difference between the 2 search results:

image

image

What I usually do is search and replace it automatically with a bash function that is something like:

gen_release_template(){
  # change to Cilium directory first
  local major="${1}"
  local minor="${2}"
  local patch="${3}"
  local next_patch="$(( ${patch} + 1 ))"
  sed "s/1.X/${major}.${minor}/g;s/X.Y.Z/${major}.${minor}.${patch}/g;s/X.Y.W/${major}.${minor}.${next_patch}/g;s/X.Y/${major}.${minor}/g" .github/ISSUE_TEMPLATE/release_template.md | xclip -selection c
}

then for example gen_release_template 1 9 10 and replace the GH issue with whatever is on my clipboard. This guarantees the links will work.

@joestringer
Copy link
Member

Can we put that somewhere in contrib/ too? I usually only put half-effort into updating the numbers since it's inconvenient.

@joestringer
Copy link
Member

Actually minor hack on top, I just integrated this into my local scripts:

GH_RELEASE_TEMPLATE="/path/to/cilium-master/.github/ISSUE_TEMPLATE/release_template.md"
gen_release_template(){                                                         
  if [ ! -e VERSION ]; then                                                     
    >&2 echo "No VERSION found. Are you in the Cilium directory?"               
    exit 1                                                                      
  fi                                                                            
                                                                                
  local version="$(cat VERSION)"                                                
  local major="$(echo $version | sed 's/^\([0-9]\+\).*/\1/g')"                  
  local minor="$(echo $version | sed 's/^[0-9]\+\.\([0-9]\+\).*/\1/g')"         
  local patch="$(echo $version | sed 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/g')"
                                                                                
  local next_patch="$(( ${patch} + 1 ))"                                        
  sed "s/1.X/${major}.${minor}/g;s/X.Y.Z/${major}.${minor}.${patch}/g;s/X.Y.W/${major}.${minor}.${next_patch}/g;s/X.Y/${major}.${minor}/g" "$GH_RELEASE_TEMPLATE" | xclip -selection c
  echo "Copied release template for ${major}.${minor}.${next_patch} to the clipboard."
}

This way I can just go into the worktree for an older release and run it without worrying about which version, and it will pick the right one.

@joestringer joestringer merged commit e4ae088 into cilium:master Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants