Explorar o código

Merge pull request #5916 from docker/autotests_fixes

Auto release improvements
Joffrey F %!s(int64=7) %!d(string=hai) anos
pai
achega
31a4ceeab0
Modificáronse 2 ficheiros con 19 adicións e 1 borrados
  1. 1 1
      script/release/release.sh
  2. 18 0
      script/release/release/repository.py

+ 1 - 1
script/release/release.sh

@@ -19,7 +19,7 @@ docker run -e GITHUB_TOKEN=$GITHUB_TOKEN -e BINTRAY_TOKEN=$BINTRAY_TOKEN -it \
     --mount type=bind,source=$(pwd),target=/src \
     --mount type=bind,source=$(pwd)/.git,target=/src/.git \
     --mount type=bind,source=$HOME/.docker,target=/root/.docker \
-    --mount type=bind,source=$HOME/.gitconfig,target=/root/.gitconfig
+    --mount type=bind,source=$HOME/.gitconfig,target=/root/.gitconfig \
     --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
     --mount type=bind,source=$HOME/.ssh,target=/root/.ssh \
     -v $HOME/.pypirc:/root/.pypirc \

+ 18 - 0
script/release/release/repository.py

@@ -196,6 +196,24 @@ class Repository(object):
             f.flush()
             self.git_repo.git.am('--3way', f.name)
 
+    def get_prs_in_milestone(self, version):
+        milestones = self.gh_repo.get_milestones(state='open')
+        milestone = None
+        for ms in milestones:
+            if ms.title == version:
+                milestone = ms
+                break
+        if not milestone:
+            print('Didn\'t find a milestone matching "{}"'.format(version))
+            return None
+
+        issues = self.gh_repo.get_issues(milestone=milestone, state='all')
+        prs = []
+        for issue in issues:
+            if issue.pull_request is not None:
+                prs.append(issue.number)
+        return sorted(prs)
+
 
 def get_contributors(pr_data):
     commits = pr_data.get_commits()