From e39a411582b6a49d65eb25caee60d635a80f29d5 Mon Sep 17 00:00:00 2001 From: frantuma Date: Mon, 16 Oct 2023 14:25:49 +0200 Subject: [PATCH 1/2] update dependencies --- pom.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 98446880..d560fcc2 100644 --- a/pom.xml +++ b/pom.xml @@ -453,7 +453,7 @@ org.testng testng - 6.8.8 + 6.14.3 test @@ -499,7 +499,7 @@ org.mockito mockito-all - 1.9.5 + 1.10.19 test @@ -546,23 +546,23 @@ - 1.6.11 - 1.0.67 - 2.15.2 + 1.6.12 + 1.0.68 + 2.15.3 2.12.2 1.9.2 - 9.4.51.v20230217 - 2.39 + 9.4.53.v20231009 + 2.40 2.5 - 2.11.0 + 2.14.0 1.5 - 3.12.0 + 3.13.0 1.10.0 2.2.14 4.13.2 - 1.4.5 + 1.4.11 1.7.36 UTF-8 https://oss.sonatype.org/content/repositories/snapshots/ From fd3ee88f501da232a6149bb09dfadd65864dbba5 Mon Sep 17 00:00:00 2001 From: frantuma Date: Mon, 16 Oct 2023 19:57:23 +0200 Subject: [PATCH 2/2] update CI Python --- .github/workflows/next-snapshot-v1.yml | 6 +-- .github/workflows/prepare-release-v1.yml | 6 +-- .github/workflows/prepare-release.yml | 6 +-- .github/workflows/release-v1.yml | 6 +-- .github/workflows/release.yml | 6 +-- CI/ghApiClient.py | 47 ++++++++++++------------ CI/lastRelease.py | 3 +- CI/lastReleaseV1.py | 3 +- CI/publishRelease.py | 1 + CI/publishReleaseV1.py | 1 + CI/releaseNotes.py | 15 ++++---- CI/releaseNotesV1.py | 15 ++++---- 12 files changed, 61 insertions(+), 54 deletions(-) diff --git a/.github/workflows/next-snapshot-v1.yml b/.github/workflows/next-snapshot-v1.yml index 25f74e63..1e052a91 100644 --- a/.github/workflows/next-snapshot-v1.yml +++ b/.github/workflows/next-snapshot-v1.yml @@ -16,10 +16,10 @@ jobs: with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Set up Python 2.7 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 2.7 + python-version: '3.10' - name: Set up Java 8 uses: actions/setup-java@v2 with: diff --git a/.github/workflows/prepare-release-v1.yml b/.github/workflows/prepare-release-v1.yml index 12c45a56..06283aca 100644 --- a/.github/workflows/prepare-release-v1.yml +++ b/.github/workflows/prepare-release-v1.yml @@ -16,10 +16,10 @@ jobs: with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Set up Python 2.7 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 2.7 + python-version: '3.10' - name: Set up Java 8 uses: actions/setup-java@v2 with: diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index b8f7da9a..f096686e 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -16,10 +16,10 @@ jobs: with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Set up Python 2.7 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 2.7 + python-version: '3.10' - name: Set up Java 8 uses: actions/setup-java@v2 with: diff --git a/.github/workflows/release-v1.yml b/.github/workflows/release-v1.yml index 6bd4776d..64b9400c 100644 --- a/.github/workflows/release-v1.yml +++ b/.github/workflows/release-v1.yml @@ -16,10 +16,10 @@ jobs: with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Set up Python 2.7 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 2.7 + python-version: '3.10' - name: Set up Java 8 uses: actions/setup-java@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce73abd7..145a8032 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,10 @@ jobs: with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - name: Set up Python 2.7 - uses: actions/setup-python@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 2.7 + python-version: '3.10' - name: Set up Java 8 uses: actions/setup-java@v2 with: diff --git a/CI/ghApiClient.py b/CI/ghApiClient.py index 76bb1deb..fcec1eac 100755 --- a/CI/ghApiClient.py +++ b/CI/ghApiClient.py @@ -2,8 +2,8 @@ import os import time -import urllib2 -import httplib +import urllib.request, urllib.error, urllib.parse +import http.client import json GH_BASE_URL = "https://api.github.com/" @@ -13,46 +13,47 @@ def readUrl(name): try: - request = urllib2.Request(GH_BASE_URL + name) + request = urllib.request.Request(GH_BASE_URL + name) request.add_header("Authorization", GH_AUTH) - content = urllib2.urlopen(request).read() + content = urllib.request.urlopen(request).read() jcont = json.loads(content) - return jcont; - except urllib2.HTTPError, e: - print 'HTTPError = ' + str(e.code) + return jcont + except urllib.error.HTTPError as e: + print(('HTTPError = ' + str(e.code))) raise e - except urllib2.URLError, e: - print 'URLError = ' + str(e.reason) + except urllib.error.URLError as e: + print(('URLError = ' + str(e.reason))) raise e - except httplib.HTTPException, e: - print 'HTTPException = ' + str(e) + except http.client.HTTPException as e: + print(('HTTPException = ' + str(e))) raise e except Exception: import traceback - print 'generic exception: ' + traceback.format_exc() + print(('generic exception: ' + traceback.format_exc())) raise IOError def postUrl(name, body): global GH_BASE_URL try: time.sleep(0.05) - request = urllib2.Request(GH_BASE_URL + name) + request = urllib.request.Request(GH_BASE_URL + name) request.add_header("Authorization", GH_AUTH) request.add_header("Accept", "application/vnd.github.v3+json") - content = urllib2.urlopen(request, body).read() + data = body.encode('utf-8') + content = urllib.request.urlopen(request, data).read() jcont = json.loads(content) - return jcont; - except urllib2.HTTPError, e: - print 'HTTPError = ' + str(e.code) - print str(e) + return jcont + except urllib.error.HTTPError as e: + print(('HTTPError = ' + str(e.code))) + print((str(e))) raise e - except urllib2.URLError, e: - print 'URLError = ' + str(e.reason) + except urllib.error.URLError as e: + print(('URLError = ' + str(e.reason))) raise e - except httplib.HTTPException, e: - print 'HTTPException = ' + str(e) + except http.client.HTTPException as e: + print(('HTTPException = ' + str(e))) raise e except Exception: import traceback - print 'generic exception: ' + traceback.format_exc() + print(('generic exception: ' + traceback.format_exc())) raise IOError diff --git a/CI/lastRelease.py b/CI/lastRelease.py index 7ab25e3d..a9b774c2 100755 --- a/CI/lastRelease.py +++ b/CI/lastRelease.py @@ -13,7 +13,8 @@ def getLastReleaseTag(): # main def main(): result = getLastReleaseTag() - print result + print(result) # here start main main() + diff --git a/CI/lastReleaseV1.py b/CI/lastReleaseV1.py index eaea9b1b..07b43e87 100755 --- a/CI/lastReleaseV1.py +++ b/CI/lastReleaseV1.py @@ -13,7 +13,8 @@ def getLastReleaseTag(): # main def main(): result = getLastReleaseTag() - print result + print(result) # here start main main() + diff --git a/CI/publishRelease.py b/CI/publishRelease.py index 0917ed25..80bbba9a 100755 --- a/CI/publishRelease.py +++ b/CI/publishRelease.py @@ -25,3 +25,4 @@ def main(tag): # here start main main(sys.argv[1]) + diff --git a/CI/publishReleaseV1.py b/CI/publishReleaseV1.py index 9dcd953a..37b0b914 100755 --- a/CI/publishReleaseV1.py +++ b/CI/publishReleaseV1.py @@ -25,3 +25,4 @@ def main(tag): # here start main main(sys.argv[1]) + diff --git a/CI/releaseNotes.py b/CI/releaseNotes.py index 45e3f998..c38359b8 100755 --- a/CI/releaseNotes.py +++ b/CI/releaseNotes.py @@ -12,13 +12,13 @@ def allPulls(releaseDate): baseurl = "https://api.github.com/repos/swagger-api/swagger-inflector/pulls/" content = ghApiClient.readUrl('repos/swagger-api/swagger-inflector/pulls?state=closed&base=master&per_page=100') for l in content: - stripped = l["url"][len(baseurl):] - mergedAt = l["merged_at"] - if mergedAt is not None: - if datetime.strptime(mergedAt, '%Y-%m-%dT%H:%M:%SZ') > releaseDate: - if not l['title'].startswith("bump snap"): - result += '\n' - result += "* " + l['title'] + " (#" + stripped + ")" + stripped = l["url"][len(baseurl):] + mergedAt = l["merged_at"] + if mergedAt is not None: + if datetime.strptime(mergedAt, '%Y-%m-%dT%H:%M:%SZ') > releaseDate: + if not l['title'].startswith("bump snap"): + result += '\n' + result += "* " + l['title'] + " (#" + stripped + ")" return result @@ -49,3 +49,4 @@ def main(last_release, release_title, tag): # here start main main(sys.argv[1], sys.argv[2], sys.argv[3]) + diff --git a/CI/releaseNotesV1.py b/CI/releaseNotesV1.py index cb6f734a..bc1868b0 100755 --- a/CI/releaseNotesV1.py +++ b/CI/releaseNotesV1.py @@ -12,13 +12,13 @@ def allPulls(releaseDate): baseurl = "https://api.github.com/repos/swagger-api/swagger-inflector/pulls/" content = ghApiClient.readUrl('repos/swagger-api/swagger-inflector/pulls?state=closed&base=v1&per_page=100') for l in content: - stripped = l["url"][len(baseurl):] - mergedAt = l["merged_at"] - if mergedAt is not None: - if datetime.strptime(mergedAt, '%Y-%m-%dT%H:%M:%SZ') > releaseDate: - if not l['title'].startswith("bump snap"): - result += '\n' - result += "* " + l['title'] + " (#" + stripped + ")" + stripped = l["url"][len(baseurl):] + mergedAt = l["merged_at"] + if mergedAt is not None: + if datetime.strptime(mergedAt, '%Y-%m-%dT%H:%M:%SZ') > releaseDate: + if not l['title'].startswith("bump snap"): + result += '\n' + result += "* " + l['title'] + " (#" + stripped + ")" return result @@ -49,3 +49,4 @@ def main(last_release, release_title, tag): # here start main main(sys.argv[1], sys.argv[2], sys.argv[3]) +