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

Configure dependabot + fix erros #85

Merged
merged 25 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
da88533
test pom with only dependencies section
Dec 9, 2021
d4e4f9d
Add dependabot configuration file
Dec 9, 2021
f84ff17
Construct pom from hardcoded dependent maven packages info
Dec 9, 2021
8172ab3
Bump jackson-dataformat-cbor from 2.9.8 to 2.13.0
dependabot[bot] Dec 9, 2021
a98d159
Bump netty-common from 4.1.32.Final to 4.1.71.Final
dependabot[bot] Dec 9, 2021
7a58167
Bump slf4j-api from 1.7.25 to 1.7.32
dependabot[bot] Dec 9, 2021
01cf905
Merge pull request #10 from zengyu714/dependabot/maven/org.slf4j-slf4…
zengyu714 Dec 9, 2021
578099c
Bump aws-core from 2.4.0 to 2.17.99
dependabot[bot] Dec 9, 2021
48c11ec
Merge pull request #9 from zengyu714/dependabot/maven/io.netty-netty-…
zengyu714 Dec 9, 2021
b3ed4f3
Merge pull request #11 from zengyu714/dependabot/maven/software.amazo…
zengyu714 Dec 9, 2021
23ff9c3
Bump regions from 2.4.0 to 2.17.99
dependabot[bot] Dec 9, 2021
7100737
Bump netty-transport-native-unix-common
dependabot[bot] Dec 9, 2021
e48f274
Merge pull request #12 from zengyu714/dependabot/maven/software.amazo…
zengyu714 Dec 9, 2021
738d485
Merge pull request #13 from zengyu714/dependabot/maven/io.netty-netty…
zengyu714 Dec 9, 2021
a2aa612
Merge pull request #8 from zengyu714/dependabot/maven/com.fasterxml.j…
zengyu714 Dec 9, 2021
882cb99
Bump commons-collections4 from 4.2 to 4.4
dependabot[bot] Dec 9, 2021
c815507
Bump commons-lang3 from 3.8.1 to 3.12.0
dependabot[bot] Dec 9, 2021
0cf8fc3
Bump commons-io from 2.6 to 2.11.0 (#17)
dependabot[bot] Dec 9, 2021
727a9bb
Bump jackson-core from 2.9.8 to 2.13.0
dependabot[bot] Dec 9, 2021
c64bd88
Import dependencies from pom file
Dec 10, 2021
5f23a5f
Merge pull request #18 from zengyu714/dependabot/maven/com.fasterxml.…
dependabot[bot] Dec 10, 2021
bf58a8a
Merge pull request #16 from zengyu714/dependabot/maven/org.apache.com…
dependabot[bot] Dec 10, 2021
ff29eb1
Bump dependencies
dependabot[bot] Dec 20, 2021
406a1e4
Add metrics-spi dependency
zengyu714 Dec 27, 2021
e70ccd4
Use common version for packages with same group id
zengyu714 Dec 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
# Add assignees, reviewers
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
105 changes: 25 additions & 80 deletions bin/kcl-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -12,85 +12,29 @@ var fs = require('fs');
var http = require('http');
var https = require('https');
var path = require('path');
var program = require('commander');
var spawn = require('child_process').spawn;
var convert = require('xml-js');
var url = require('url');
var util = require('util');
const { program } = require('commander');

const mavenFile = fs.readFileSync(path.join(__dirname, '..', 'pom.xml'), 'utf8');
const mavenJson = JSON.parse(convert.xml2json(mavenFile, { compact: true }));
const dependencyArray = mavenJson.project.dependencies.dependency;
const propertyDict = Object.fromEntries(Object.entries(mavenJson.project.properties).map(([k, v]) => [`$\{${k}\}`, v._text]));

var MAVEN_PACKAGE_LIST = [
getMavenPackageInfo('software.amazon.kinesis', 'amazon-kinesis-client-multilang', '2.1.2'),
getMavenPackageInfo('software.amazon.kinesis', 'amazon-kinesis-client', '2.1.2'),
getMavenPackageInfo('software.amazon.awssdk', 'kinesis', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'aws-cbor-protocol', '2.4.0'),
getMavenPackageInfo('com.fasterxml.jackson.dataformat', 'jackson-dataformat-cbor', '2.9.8'),
getMavenPackageInfo('software.amazon.awssdk', 'aws-json-protocol', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'dynamodb', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'cloudwatch', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'netty-nio-client', '2.4.0'),
getMavenPackageInfo('io.netty', 'netty-codec-http', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-codec-http2', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-codec', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-transport', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-resolver', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-common', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-buffer', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-handler', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-transport-native-epoll', '4.1.32.Final'),
getMavenPackageInfo('io.netty', 'netty-transport-native-unix-common', '4.1.32.Final'),
getMavenPackageInfo('com.typesafe.netty', 'netty-reactive-streams-http', '2.0.0'),
getMavenPackageInfo('com.typesafe.netty', 'netty-reactive-streams', '2.0.0'),
getMavenPackageInfo('org.reactivestreams', 'reactive-streams', '1.0.2'),
getMavenPackageInfo('com.google.guava', 'guava', '26.0-jre'),
getMavenPackageInfo('com.google.code.findbugs', 'jsr305', '3.0.2'),
getMavenPackageInfo('org.checkerframework', 'checker-qual', '2.5.2'),
getMavenPackageInfo('com.google.errorprone', 'error_prone_annotations', '2.1.3'),
getMavenPackageInfo('com.google.j2objc', 'j2objc-annotations', '1.1'),
getMavenPackageInfo('org.codehaus.mojo', 'animal-sniffer-annotations', '1.14'),
getMavenPackageInfo('com.google.protobuf', 'protobuf-java', '2.6.1'),
getMavenPackageInfo('org.apache.commons', 'commons-lang3', '3.8.1'),
getMavenPackageInfo('org.slf4j', 'slf4j-api', '1.7.25'),
getMavenPackageInfo('io.reactivex.rxjava2', 'rxjava', '2.1.14'),
getMavenPackageInfo('software.amazon.awssdk', 'sts', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'aws-query-protocol', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'protocol-core', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'profiles', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'sdk-core', '2.4.0'),
getMavenPackageInfo('com.fasterxml.jackson.core', 'jackson-core', '2.9.8'),
getMavenPackageInfo('com.fasterxml.jackson.core', 'jackson-databind', '2.9.8'),
getMavenPackageInfo('software.amazon.awssdk', 'auth', '2.4.0'),
getMavenPackageInfo('software.amazon', 'flow', '1.7'),
getMavenPackageInfo('software.amazon.awssdk', 'http-client-spi', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'regions', '2.4.0'),
getMavenPackageInfo('com.fasterxml.jackson.core', 'jackson-annotations', '2.9.0'),
getMavenPackageInfo('software.amazon.awssdk', 'annotations', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'utils', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'aws-core', '2.4.0'),
getMavenPackageInfo('software.amazon.awssdk', 'apache-client', '2.4.0'),
getMavenPackageInfo('org.apache.httpcomponents', 'httpclient', '4.5.6'),
getMavenPackageInfo('commons-codec', 'commons-codec', '1.10'),
getMavenPackageInfo('org.apache.httpcomponents', 'httpcore', '4.4.10'),
getMavenPackageInfo('com.amazonaws', 'aws-java-sdk-core', '1.11.477'),
getMavenPackageInfo('commons-logging', 'commons-logging', '1.1.3'),
getMavenPackageInfo('software.amazon.ion', 'ion-java', '1.0.2'),
getMavenPackageInfo('joda-time', 'joda-time', '2.8.1'),
getMavenPackageInfo('ch.qos.logback', 'logback-classic', '1.2.3'),
getMavenPackageInfo('ch.qos.logback', 'logback-core', '1.2.3'),
getMavenPackageInfo('com.beust', 'jcommander', '1.72'),
getMavenPackageInfo('commons-io', 'commons-io', '2.6'),
getMavenPackageInfo('org.apache.commons', 'commons-collections4', '4.2'),
getMavenPackageInfo('commons-beanutils', 'commons-beanutils', '1.9.3'),
getMavenPackageInfo('commons-collections', 'commons-collections', '3.2.2')
];
// Read Java dependencies from pom.xml
const MAVEN_PACKAGE_LIST = dependencyArray.map(
dep => getMavenPackageInfo(dep.groupId._text, dep.artifactId._text, propertyDict[dep.version._text] || dep.version._text)
);

var DEFAULT_JAR_PATH = path.resolve(path.join(__dirname, '..', 'lib', 'jars'));
var MULTI_LANG_DAEMON_CLASS = 'software.amazon.kinesis.multilang.MultiLangDaemon';
var MAX_HTTP_REDIRECT_FOLLOW = 3;


function bootstrap() {
var args = parseArguments();
downloadMavenPackages(MAVEN_PACKAGE_LIST, args.jarPath, function(err) {
downloadMavenPackages(MAVEN_PACKAGE_LIST, args.jarPath, function (err) {
if (err) {
errorExit(util.format('Unable to download MultiLangDaemon jar files from maven: %s', err));
}
Expand All @@ -110,13 +54,14 @@ function parseArguments() {
.option('-c, --jar-path [jar path]', 'path where all multi-language daemon jar files will be downloaded (optional)')
.option('-e, --execute', 'execute the KCL application')
.parse(process.argv);


const options = program.opts();
var args = {
'properties': program.properties,
'logConfiguration': program.logConfiguration ? program.logConfiguration: null,
'java': (program.java ? program.java : (process.env.JAVA_HOME ? createJavaHomeExecutablePath() : null)),
'jarPath': (program.jarPath ? program.jarPath : DEFAULT_JAR_PATH),
'execute': program.execute
'properties': options.properties,
'logConfiguration': options.logConfiguration ? options.logConfiguration : null,
'java': (options.java ? options.java : (process.env.JAVA_HOME ? createJavaHomeExecutablePath() : null)),
'jarPath': (options.jarPath ? options.jarPath : DEFAULT_JAR_PATH),
'execute': options.execute
};

if (!args.properties) {
Expand Down Expand Up @@ -174,7 +119,7 @@ function downloadMavenPackages(mavenPackages, destinationDirectory, callback) {
var remainingPackages = mavenPackages.length;
var callbackInvoked = false;

var downloadMavenPackageCallback = function(err, filePath) {
var downloadMavenPackageCallback = function (err, filePath) {
remainingPackages = remainingPackages - 1;
if (!callbackInvoked) {
if (!err) {
Expand All @@ -188,13 +133,13 @@ function downloadMavenPackages(mavenPackages, destinationDirectory, callback) {
}
};

for (var i = 0 ; i < mavenPackages.length ; ++i) {
for (var i = 0; i < mavenPackages.length; ++i) {
downloadMavenPackage(mavenPackages[i], destinationDirectory, downloadMavenPackageCallback);
}
}

function downloadMavenPackage(mavenPackage, destinationDirectory, callback) {
process.nextTick(function() {
process.nextTick(function () {
var mavenPackageUrlInfo = getMavenPackageUrlInfo(mavenPackage);
var destinationFile = path.join(destinationDirectory, mavenPackageUrlInfo.fileName);
if (fs.existsSync(destinationFile)) {
Expand All @@ -216,7 +161,7 @@ function httpDownloadFile(requestUrl, destinationFile, redirectCount, callback)
path: url.parse(requestUrl).path,
agent: false
};
var request = protocol.get(options, function(response) {
var request = protocol.get(options, function (response) {
// Non-2XX response.
if (response.statusCode > 300) {
if (response.statusCode > 300 && response.statusCode < 400 && response.headers.location) {
Expand All @@ -233,7 +178,7 @@ function httpDownloadFile(requestUrl, destinationFile, redirectCount, callback)
response.pipe(destinationFileStream);

var callbackInvoked = false;
var destinationFileStreamFinishCallback = function() {
var destinationFileStreamFinishCallback = function () {
if (callbackInvoked) {
return;
}
Expand All @@ -244,7 +189,7 @@ function httpDownloadFile(requestUrl, destinationFile, redirectCount, callback)
// Older Node.js version may not support 'finish' event.
destinationFileStream.on('close', destinationFileStreamFinishCallback);
}
}).on('error', function(err) {
}).on('error', function (err) {
fs.unlink(destinationFile);
callback(err);
});
Expand Down Expand Up @@ -285,7 +230,7 @@ function isDirectory(path) {
function createDirectory(path) {
try {
fs.mkdirSync(path);
} catch(e) {
} catch (e) {
if (e.code !== 'EEXIST') {
throw e;
}
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@
"doc": "grunt jsdoc"
},
"dependencies": {
"commander": "~2.6.0"
"commander": "~8.3.0",
"xml-js": "^1.6.11"
},
"devDependencies": {
"async": "^0.9.2",
"async": "^3.2.2",
"aws-sdk": "^2.390.0",
"chai": "^1.10.0",
"chai": "^4.3.4",
"grunt": "^1.0.3",
"grunt-cli": "^1.3.2",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-jshint": "^1.1.0",
"grunt-jsdoc": "^1.1.0",
"grunt-mocha-test": "^0.12.7",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-jshint": "^3.1.1",
"grunt-jsdoc": "^2.4.1",
"grunt-mocha-test": "^0.13.3",
"ink-docstrap": "^1.3.2",
"log4js": "^0.6.38",
"mocha": "^5.2.0",
"sinon": "^1.17.7"
"log4js": "^6.3.0",
"mocha": "^9.1.3",
"sinon": "^12.0.1"
},
"homepage": "https://github.com/awslabs/amazon-kinesis-client-nodejs",
"repository": {
Expand Down
Loading