From 3b6ecf9ea210fcf1f4bc4c29149ebc31b0638ea4 Mon Sep 17 00:00:00 2001 From: simitt Date: Fri, 3 Jun 2022 14:36:33 +0200 Subject: [PATCH 1/4] Add license headers to java files --- apm-lambda-extension/Makefile | 2 ++ .../src/main/java/samtestingjava/App.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/apm-lambda-extension/Makefile b/apm-lambda-extension/Makefile index b0339735..9a22f7b4 100644 --- a/apm-lambda-extension/Makefile +++ b/apm-lambda-extension/Makefile @@ -24,10 +24,12 @@ all: build check-licenses: go install github.com/elastic/go-licenser@v0.4.0 go run github.com/elastic/go-licenser@v0.4.0 -d . + go run github.com/elastic/go-licenser@v0.4.0 -d -ext .java . update-licenses: go install github.com/elastic/go-licenser@v0.4.0 go run github.com/elastic/go-licenser@v0.4.0 . + go run github.com/elastic/go-licenser@v0.4.0 -ext .java . lint: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.0 diff --git a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java b/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java index 88cebf26..bf3a008b 100644 --- a/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java +++ b/apm-lambda-extension/e2e-testing/sam-java/sam-testing-java/src/main/java/samtestingjava/App.java @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + package samtestingjava; import java.io.BufferedReader; From 8e56d02297ae6dcad4d8e613ddb1772ae316778d Mon Sep 17 00:00:00 2001 From: simitt Date: Fri, 3 Jun 2022 14:37:37 +0200 Subject: [PATCH 2/4] Add license headers to python files --- .../sam-python/sam-testing-python/app.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/app.py b/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/app.py index cf356f37..ddb5f60a 100644 --- a/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/app.py +++ b/apm-lambda-extension/e2e-testing/sam-python/sam-testing-python/app.py @@ -1,3 +1,22 @@ +#!/usr/bin/env python + +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. 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. + import json import os From 9b18ae87ab7a95d04bda9cf7f46a594752a0f241 Mon Sep 17 00:00:00 2001 From: simitt Date: Fri, 3 Jun 2022 14:46:33 +0200 Subject: [PATCH 3/4] Add license headers to js files --- apm-lambda-extension/Makefile | 2 ++ apm-lambda-extension/cli/.eslintrc.js | 17 +++++++++++++++++ apm-lambda-extension/cli/build-and-publish.js | 2 +- apm-lambda-extension/cli/elastic-lambda.js | 3 +-- apm-lambda-extension/cli/install.js | 2 +- apm-lambda-extension/cli/profile.js | 17 +++++++++++++++++ apm-lambda-extension/cli/profile/code/index.js | 17 +++++++++++++++++ .../cli/profile/elasticagent/index.js | 17 +++++++++++++++++ .../cli/profile/noagent/index.js | 17 +++++++++++++++++ .../cli/tests/build-and-publish.test.js | 2 +- apm-lambda-extension/cli/tests/profile.test.js | 2 +- .../cli/tests/update-layer.test.js | 2 +- apm-lambda-extension/cli/update-function-env.js | 2 +- apm-lambda-extension/cli/update-layer.js | 2 +- .../sam-nodejs/sam-testing-nodejs/app.js | 17 +++++++++++++++++ 15 files changed, 112 insertions(+), 9 deletions(-) diff --git a/apm-lambda-extension/Makefile b/apm-lambda-extension/Makefile index 9a22f7b4..142799a9 100644 --- a/apm-lambda-extension/Makefile +++ b/apm-lambda-extension/Makefile @@ -25,11 +25,13 @@ check-licenses: go install github.com/elastic/go-licenser@v0.4.0 go run github.com/elastic/go-licenser@v0.4.0 -d . go run github.com/elastic/go-licenser@v0.4.0 -d -ext .java . + go run github.com/elastic/go-licenser@v0.4.0 -d -ext .js . update-licenses: go install github.com/elastic/go-licenser@v0.4.0 go run github.com/elastic/go-licenser@v0.4.0 . go run github.com/elastic/go-licenser@v0.4.0 -ext .java . + go run github.com/elastic/go-licenser@v0.4.0 -ext .js . lint: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.0 diff --git a/apm-lambda-extension/cli/.eslintrc.js b/apm-lambda-extension/cli/.eslintrc.js index 4b6b5c20..8b829906 100644 --- a/apm-lambda-extension/cli/.eslintrc.js +++ b/apm-lambda-extension/cli/.eslintrc.js @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + module.exports = { env: { browser: true, diff --git a/apm-lambda-extension/cli/build-and-publish.js b/apm-lambda-extension/cli/build-and-publish.js index b7d6781c..ecddcc69 100644 --- a/apm-lambda-extension/cli/build-and-publish.js +++ b/apm-lambda-extension/cli/build-and-publish.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/elastic-lambda.js b/apm-lambda-extension/cli/elastic-lambda.js index 9cdc638a..9e46fad4 100755 --- a/apm-lambda-extension/cli/elastic-lambda.js +++ b/apm-lambda-extension/cli/elastic-lambda.js @@ -1,4 +1,3 @@ -#!/usr/bin/env node // Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright @@ -7,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/install.js b/apm-lambda-extension/cli/install.js index d1275cad..7b32fe5e 100644 --- a/apm-lambda-extension/cli/install.js +++ b/apm-lambda-extension/cli/install.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/profile.js b/apm-lambda-extension/cli/profile.js index 438cb7d9..e0a019b1 100644 --- a/apm-lambda-extension/cli/profile.js +++ b/apm-lambda-extension/cli/profile.js @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + 'use strict' const yaml = require('js-yaml') const AWS = require('aws-sdk') diff --git a/apm-lambda-extension/cli/profile/code/index.js b/apm-lambda-extension/cli/profile/code/index.js index 3b1d95a6..16f0b4c9 100644 --- a/apm-lambda-extension/cli/profile/code/index.js +++ b/apm-lambda-extension/cli/profile/code/index.js @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + exports.handler = async (event) => { const response = { statuscode: 200, diff --git a/apm-lambda-extension/cli/profile/elasticagent/index.js b/apm-lambda-extension/cli/profile/elasticagent/index.js index 945e7b11..f7c0ec8d 100644 --- a/apm-lambda-extension/cli/profile/elasticagent/index.js +++ b/apm-lambda-extension/cli/profile/elasticagent/index.js @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + const apm = require('elastic-apm-node').start({}) exports.handler = apm.lambda(function handler (event, context, callback) { return new Promise(function (resolve, reject) { diff --git a/apm-lambda-extension/cli/profile/noagent/index.js b/apm-lambda-extension/cli/profile/noagent/index.js index 3b1d95a6..16f0b4c9 100644 --- a/apm-lambda-extension/cli/profile/noagent/index.js +++ b/apm-lambda-extension/cli/profile/noagent/index.js @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + exports.handler = async (event) => { const response = { statuscode: 200, diff --git a/apm-lambda-extension/cli/tests/build-and-publish.test.js b/apm-lambda-extension/cli/tests/build-and-publish.test.js index a0b87dc5..54ff090d 100644 --- a/apm-lambda-extension/cli/tests/build-and-publish.test.js +++ b/apm-lambda-extension/cli/tests/build-and-publish.test.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/tests/profile.test.js b/apm-lambda-extension/cli/tests/profile.test.js index 6ea681c1..c4843c78 100644 --- a/apm-lambda-extension/cli/tests/profile.test.js +++ b/apm-lambda-extension/cli/tests/profile.test.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/tests/update-layer.test.js b/apm-lambda-extension/cli/tests/update-layer.test.js index d7f5683c..24a6d3e1 100644 --- a/apm-lambda-extension/cli/tests/update-layer.test.js +++ b/apm-lambda-extension/cli/tests/update-layer.test.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/update-function-env.js b/apm-lambda-extension/cli/update-function-env.js index d313bc36..e72cd419 100644 --- a/apm-lambda-extension/cli/update-function-env.js +++ b/apm-lambda-extension/cli/update-function-env.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/cli/update-layer.js b/apm-lambda-extension/cli/update-layer.js index daf0a318..d2be6bfe 100644 --- a/apm-lambda-extension/cli/update-layer.js +++ b/apm-lambda-extension/cli/update-layer.js @@ -6,7 +6,7 @@ // 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 +// 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 diff --git a/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js b/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js index 67044976..252f7117 100644 --- a/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js +++ b/apm-lambda-extension/e2e-testing/sam-nodejs/sam-testing-nodejs/app.js @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. 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. + // const url = 'http://checkip.amazonaws.com/'; const apm = require('elastic-apm-node').start({/*...*/}) let response; From d8470dad94a9eff11a23c5a2a283e36497f6a075 Mon Sep 17 00:00:00 2001 From: simitt Date: Fri, 3 Jun 2022 15:00:13 +0200 Subject: [PATCH 4/4] Remove updating js files automatically --- apm-lambda-extension/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/apm-lambda-extension/Makefile b/apm-lambda-extension/Makefile index 142799a9..a69bf9bf 100644 --- a/apm-lambda-extension/Makefile +++ b/apm-lambda-extension/Makefile @@ -31,7 +31,6 @@ update-licenses: go install github.com/elastic/go-licenser@v0.4.0 go run github.com/elastic/go-licenser@v0.4.0 . go run github.com/elastic/go-licenser@v0.4.0 -ext .java . - go run github.com/elastic/go-licenser@v0.4.0 -ext .js . lint: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.0