Skip to content

Commit

Permalink
Merge branch 'master' into feature/treat-kotlin-deprecated-as-a-depre…
Browse files Browse the repository at this point in the history
…cated-operation-master
  • Loading branch information
sokomishalov authored Nov 16, 2023
2 parents 803d754 + bfd25e2 commit fc73145
Show file tree
Hide file tree
Showing 61 changed files with 1,216 additions and 666 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "maven"
target-branch: "master"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
- package-ecosystem: "maven"
target-branch: "1.5"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
16 changes: 16 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
fail-on-severity: high
6 changes: 3 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Set up Python 2.7
uses: MatteoH2O1999/setup-python@v1
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 2.7
python-version: '3.10'
- name: Set up Java 11
uses: actions/setup-java@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Set up Python 2.7
uses: MatteoH2O1999/setup-python@v1
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 2.7
python-version: '3.10'
- name: Set up Java 11
uses: actions/setup-java@v1
with:
Expand Down
117 changes: 0 additions & 117 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
20 changes: 18 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.6.jar
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
47 changes: 24 additions & 23 deletions CI/ghApiClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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 as e:
print ('HTTPError = ' + str(e.code))
return jcont
except urllib.error.HTTPError as e:
print(('HTTPError = ' + str(e.code)))
raise e
except urllib2.URLError as e:
print ('URLError = ' + str(e.reason))
except urllib.error.URLError as e:
print(('URLError = ' + str(e.reason)))
raise e
except httplib.HTTPException as 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 as 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 as e:
print ('URLError = ' + str(e.reason))
except urllib.error.URLError as e:
print(('URLError = ' + str(e.reason)))
raise e
except httplib.HTTPException as 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
15 changes: 8 additions & 7 deletions CI/releaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ def allPulls(releaseDate):
baseurl = "https://api.github.com/repos/swagger-api/swagger-core/pulls/"
content = ghApiClient.readUrl('repos/swagger-api/swagger-core/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


Expand Down Expand Up @@ -49,3 +49,4 @@ def main(last_release, release_title, tag):

# here start main
main(sys.argv[1], sys.argv[2], sys.argv[3])

60 changes: 60 additions & 0 deletions CI/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/python

import sys
import json
from datetime import datetime
import ghApiClient

def allPulls(releaseDate):

result = ""

baseurl = "https://api.github.com/repos/swagger-api/swagger-core/pulls/"
content = ghApiClient.readUrl('repos/swagger-api/swagger-core/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 + ")"
return result


def lastReleaseDate(tag):
content = ghApiClient.readUrl('repos/swagger-api/swagger-core/releases/tags/' + tag)
publishedAt = content["published_at"]
return datetime.strptime(publishedAt, '%Y-%m-%dT%H:%M:%SZ')


def addRelease(release_title, tag, content):
payload = "{\"tag_name\":\"" + tag + "\", "
payload += "\"name\":" + json.dumps(release_title) + ", "
payload += "\"body\":" + json.dumps(content) + ", "
payload += "\"draft\":" + "true" + ", "
payload += "\"prerelease\":" + "false" + ", "
payload += "\"target_commitish\":\"" + "master" + "\"}"
content = ghApiClient.postUrl('repos/swagger-api/swagger-core/releases', payload)
return content

def getReleases():
content = ghApiClient.readUrl('repos/swagger-api/swagger-core/releases')
return content

# main
def main(last_release, release_title, tag):
baseurl = "https://api.github.com/repos/swagger-api/swagger-core/pulls/"
payload = "{\"tag_name\":\"" + tag + "\", "
payload += "\"name\":" + json.dumps(release_title) + ", "
payload += "\"body\":" + json.dumps(content) + ", "
payload += "\"draft\":" + "true" + ", "
payload += "\"prerelease\":" + "false" + ", "
payload += "\"target_commitish\":\"" + "master" + "\"}"
content = ghApiClient.postUrl('repos/swagger-api/swagger-core/releases', payload)
result = allPulls(lastReleaseDate('v' + last_release))
addRelease (release_title, tag, result)

# here start main
main(sys.argv[1], sys.argv[2], sys.argv[3])

Loading

0 comments on commit fc73145

Please sign in to comment.