forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manifest rebase script updates (zephyrproject-rtos#21)
- Add pr_comment.py script which spoots out the tag info for both the zephyr and zephyr-intel repos to be pasted into the respective PRs. - Remove a duplicate line from the tag_manifest.py script. - Use rebase branch name to get date stamp It's preferable for the tag datestamp to match the branch datestamp to help avoid confusion in the PR. i.e. Tag date doesn't match branch date = confusing. So make 'em match. Extract the datestamp from the branch name. In the event the branch is created the same day as tagging happens, can just run without passing the branch. Generally should not run the tagging before the branch is created, to avoid mismatched branch and tag date mismatch. Signed-off-by: Connor Graydon <connor.graydon@intel.com> Signed-off-by: Connor Graydon <connor.graydon@intel.com>
- Loading branch information
Showing
2 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" Generate the PR comments for the tagging | ||
This scrip generates the PR comment to be added to both the zephyr and | ||
zephyr-intel_PRs for the manifest update. | ||
Working dir should be same as for tag_manifest.py. | ||
This needs to run AFTER the tagging script. | ||
Takes an argument of the tag that was pushed. i.e. zephyr-3.1.99-intel-20220902 | ||
Currently just splats the text to the screen for copy and paste. Will eventually | ||
just push the comments to the respective PRs. | ||
""" | ||
|
||
import os | ||
import sys | ||
import argparse | ||
from git import Repo | ||
from git import Git | ||
|
||
|
||
os.system("clear") | ||
|
||
|
||
# Create the parser and add arguments | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument(dest='tag', help="tag to create PR comments for") | ||
|
||
# Parse and print the results | ||
args = parser.parse_args() | ||
print(args.tag) | ||
|
||
|
||
tag = args.tag | ||
|
||
# For testing | ||
#tag = 'zephyr-3.1.99-intel-20220902' | ||
#tag = "fmos-self-test" | ||
|
||
workspace = "/srv/build/manifest" # or whatever your workdir is | ||
|
||
for repo_name in ['zephyr', 'zephyr-intel']: | ||
repo_path = os.path.join(workspace, repo_name) | ||
repo = Repo(repo_path) | ||
tags = repo.tags | ||
for thing in tags: | ||
if tag == thing.name: | ||
print(f"{repo_name.title()} {thing.commit} has been tagged as {thing.name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters