Skip to content

Commit

Permalink
chore: fix dependency errors (#11)
Browse files Browse the repository at this point in the history
fix dependency problem in pom.xml:
define used undeclared dependencies.
remove unused declared dependencies.
except for org.junit.jupiter:junit-jupiter-engine
since it is used implicitly as a default test engine.
override surefire-junit-* declaration to support JUnit5.

rollback from JUnit5 to Junit4:
due to multiple validation problems as well as problems with executing IT tests
return to using JUnit4.
remove redundant dependencies and add junit4 dependency.
change unit tests to work with Junit4 classes and attributes.
convert ITContainersTest to parameterized class.

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: remove region tag from autogen file

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
minherz and gcf-owl-bot[bot] committed Dec 7, 2021
1 parent 48e35a8 commit b9f6ac0
Show file tree
Hide file tree
Showing 21 changed files with 523 additions and 133 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -10,8 +10,8 @@ Thanks for stopping by to let us know something could be better!

Please run down the following list and make sure you've tried the usual "quick fixes":

- [Search the issues](https://github.com/googleapis/java-logging-servlet-initializer/issues) already opened
- Check for answers on [StackOverflow](http://stackoverflow.com/questions/tagged/google-cloud-platform)
- Search the issues already opened: https://github.com/googleapis/java-logging-servlet-initializer/issues
- Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform

If you are still having issues, please include as much information as possible:

Expand All @@ -21,7 +21,7 @@ If you are still having issues, please include as much information as possible:
General, Core, and Other are also allowed as types
2. OS type and version:
3. Java version:
4. logging-logback version(s):
4. logging-servlet-initializer version(s):

#### Steps to reproduce

Expand All @@ -35,8 +35,7 @@ If you are still having issues, please include as much information as possible:
```

#### Stack trace

```text
```
Any relevant stacktrace here.
```

Expand All @@ -46,6 +45,7 @@ Any relevant stacktrace here.

#### Any additional information below


Following these steps guarantees the quickest resolution possible.

Thanks!
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
@@ -1,5 +1,5 @@
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-logging-logback/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-logging-servlet-initializer/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
Expand Down
Empty file added .github/snippet-bot.yml
Empty file.
54 changes: 54 additions & 0 deletions .github/workflows/approve-readme.yaml
@@ -0,0 +1,54 @@
on:
pull_request:
name: auto-merge-readme
jobs:
approve:
runs-on: ubuntu-latest
if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme'
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
script: |
// only approve PRs from yoshi-automation
if (context.payload.pull_request.user.login !== "yoshi-automation") {
return;
}
// only approve PRs like "chore: release <release version>"
if (!context.payload.pull_request.title === "chore: regenerate README") {
return;
}
// only approve PRs with README.md and synth.metadata changes
const files = new Set(
(
await github.paginate(
github.pulls.listFiles.endpoint({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
})
)
).map(file => file.filename)
);
if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) {
return;
}
// approve README regeneration PR
await github.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Rubber stamped PR!',
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
});
// attach automerge label
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['automerge']
});
14 changes: 14 additions & 0 deletions .github/workflows/samples.yaml
@@ -0,0 +1,14 @@
on:
pull_request:
name: samples
jobs:
checkstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Run checkstyle
run: mvn -P lint --quiet --batch-mode checkstyle:check
working-directory: samples/snippets
45 changes: 45 additions & 0 deletions .kokoro/readme.sh
@@ -0,0 +1,45 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed 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.

set -eo pipefail

cd ${KOKORO_ARTIFACTS_DIR}/github/java-logging-servlet-initializer

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Kokoro exposes this as a file, but the scripts expect just a plain variable.
export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key)

# Setup git credentials
echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials
git config --global credential.helper 'store --file ~/.git-credentials'

python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool

set +e
python3.6 -m autosynth.synth \
--repository=googleapis/java-logging-servlet-initializer \
--synth-file-name=.github/readme/synth.py \
--metadata-path=.github/readme/synth.metadata \
--pr-title="chore: regenerate README" \
--branch-suffix="readme"

# autosynth returns 28 to signal there are no changes
RETURN_CODE=$?
if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]]
then
exit ${RETURN_CODE}
fi
2 changes: 1 addition & 1 deletion .kokoro/release/publish_javadoc.sh
Expand Up @@ -33,7 +33,7 @@ python3 -m pip install gcp-docuploader
# compile all packages
mvn clean install -B -q -DskipTests=true

export NAME=google-cloud-logging-logback
export NAME=google-cloud-logging-servlet-initializer
export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)

# build the docs
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/release/publish_javadoc11.sh
Expand Up @@ -33,7 +33,7 @@ python3 -m pip install gcp-docuploader
# compile all packages
mvn clean install -B -q -DskipTests=true

export NAME=google-cloud-logging-logback
export NAME=google-cloud-logging-servlet-initializer
export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)

# cloud RAD generation
Expand Down
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Expand Up @@ -15,21 +15,21 @@ race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand Down Expand Up @@ -91,4 +91,4 @@ harassment or threats to anyone's safety, we may take action without notice.

This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
available at
`https://www.contributor-covenant.org/version/1/4/code-of-conduct.html`
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
2 changes: 1 addition & 1 deletion codecov.yaml
@@ -1,4 +1,4 @@
---
codecov:
ci:
- source.cloud.google.com
- source.cloud.google.com
2 changes: 1 addition & 1 deletion java.header
Expand Up @@ -12,4 +12,4 @@
^ \* 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\.$
^ \*/$
^ \*/$
2 changes: 1 addition & 1 deletion license-checks.xml
Expand Up @@ -7,4 +7,4 @@
<property name="fileExtensions" value="java"/>
<property name="headerFile" value="${checkstyle.header.file}"/>
</module>
</module>
</module>
23 changes: 7 additions & 16 deletions pom.xml
Expand Up @@ -32,7 +32,6 @@
<easymock.version>3.6</easymock.version>
<logging.version>3.5.0</logging.version>
<jakarta.servlet.api.version>4.0.4</jakarta.servlet.api.version>
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<jetty.version>9.4.44.v20210927</jetty.version>
<tomcat.version>9.0.45</tomcat.version>
<undertow.version>2.2.7.Final</undertow.version>
Expand Down Expand Up @@ -99,12 +98,16 @@
<artifactId>jakarta.servlet-api</artifactId>
<version>${jakarta.servlet.api.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<!--=========== Test Dependencies ==============-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -231,18 +234,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<!-- Excludes integration tests and smoke tests when unit tests are run -->
<excludes>
<exclude>**/*SmokeTest.java</exclude>
<exclude>**/IT*.java</exclude>
</excludes>
<reportNameSuffix>sponge_log</reportNameSuffix>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit b9f6ac0

Please sign in to comment.