Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8a65b58
ci(showcase): add showcase IT coverage
burkedavison Nov 22, 2022
830130f
ci(showcase): rework showcase coverage for combined report
burkedavison Nov 22, 2022
eed1de7
chore(deps): update dependency gradle to v7.6 (#1101)
renovate-bot Nov 28, 2022
fa32e9f
ci(showcase): debug showcase integration coverage report in sonar
burkedavison Nov 28, 2022
c58a335
ci(showcase): remove duplicate bazel coverage stage
burkedavison Nov 28, 2022
c52f041
ci(showcase): invoke sonar after integration tests
burkedavison Nov 28, 2022
f990fa6
ci(showcase): debug with maven and sonar
burkedavison Nov 28, 2022
3a80031
ci(showcase): attempt sonar workaround for lcov coverage parsing
burkedavison Nov 28, 2022
6eebc70
chore(showcase): create maven showcase module
burkedavison Nov 29, 2022
9688407
chore: relocate gapic-generator-java pom.xml to subfolder
burkedavison Nov 29, 2022
e5d3895
fix: ensure all tests work with new project structure
burkedavison Nov 29, 2022
9bf98f4
fix: set surefire working directory, and revert source adjustments
burkedavison Nov 30, 2022
15200c0
fix: formatter
burkedavison Nov 30, 2022
5960f1e
Merge branch 'main' into showcase-coverage
burkedavison Nov 30, 2022
20300fb
Merge branch 'relocate-primary-project' into showcase-coverage
burkedavison Nov 30, 2022
dbf9342
chore: relocate gapic-generator-java pom.xml to subfolder (#1105)
burkedavison Nov 30, 2022
e1a4c49
chore: update showcase maven module to generate and verify golden source
burkedavison Dec 1, 2022
af83acf
chore: update showcase maven module to generate and verify golden source
burkedavison Dec 1, 2022
920640d
chore: add showcase golden source to maven submodule
burkedavison Dec 1, 2022
bc16fa0
chore: upload two coverage reports to sonar
burkedavison Dec 1, 2022
a29727d
chore: show proto folder contents during verify_proto
burkedavison Dec 1, 2022
b73930a
fix: only diff proto src/main/java, ignoring src/main/proto
burkedavison Dec 1, 2022
6cc7e9d
chore(main): release 2.11.0 (#1081)
release-please[bot] Dec 1, 2022
fde22dc
chore: change showcase version to 0.0.1-SNAPSHOT
burkedavison Dec 1, 2022
c7329fd
chore: add mvn -version to sonar workflow
burkedavison Dec 2, 2022
a1fe3e0
fix: set showcase client to 0.0.1-SNAPSHOT
burkedavison Dec 2, 2022
32b01ec
fix: explicitly set shade plugin output directory
burkedavison Dec 2, 2022
9c5ee07
chore: remove aggregator from build
burkedavison Dec 2, 2022
c1593eb
fix: coverage report locations
burkedavison Dec 2, 2022
b7358f5
fix: skip linting on generated showcase files
burkedavison Dec 2, 2022
60dc190
fix: sonar coverage for non-standard directory structure (#1108)
burkedavison Dec 5, 2022
ba0dcd2
fix: exclude generated showcase from license header check
burkedavison Dec 5, 2022
0e0287d
fix: single-line 'find' syntax
burkedavison Dec 5, 2022
a35db60
fix: use provided ignore flag
burkedavison Dec 5, 2022
1c5b6de
Merge branch 'main' into showcase-coverage
burkedavison Dec 6, 2022
06333d5
ci(showcase): rework github actions for showcase golden and integrati…
burkedavison Dec 6, 2022
31eaefd
ci(showcase): simplify sonar github actions workflow
burkedavison Dec 6, 2022
84a39e4
ci(showcase): remove showcase from /test/integration golden suite
burkedavison Dec 6, 2022
b11a68c
ci(showcase): simplify showcase invocation
burkedavison Dec 6, 2022
aa3e923
fix(showcase): ensure generated showcase protos are not deleted
burkedavison Dec 6, 2022
55bacad
ci(showcase): update workflow and documentation for showcase
burkedavison Dec 6, 2022
cf5d937
ci(showcase): disable snippet-bot for generated showcase client
burkedavison Dec 6, 2022
17ccc21
ci(showcase): disable snippet-bot for showcase (#1113)
burkedavison Dec 6, 2022
d8ff19c
Merge branch 'main' into showcase-coverage
burkedavison Dec 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/snippet-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ alwaysCreateStatusCheck: false
ignoreFiles:
- src/test/**
- test/**
- showcase/**
56 changes: 56 additions & 0 deletions .github/workflows/ci-maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ on:
branches:
- main
pull_request:

name: ci-maven

env:
SHOWCASE_VERSION: 0.25.0

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -32,3 +37,54 @@ jobs:

- name: Java Linter
run: mvn fmt:check

showcase:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11 ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: temurin
- run: java -version

- name: Bazel File Cache Setup
id: cache-bazel
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}
- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
echo "No cache found."
- name: Bazel Cache Found
if: steps.cache-bazel.outputs.cache-hit == 'true'
run: |
echo -n "Cache found. Cache size: "
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the CACHE_VERSION secret in"
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
echo "(use any random string, any GUID will work)"
echo "and it will start over with a clean cache."
echo "The old one will disappear after 7 days."

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl unzip
- name: Install showcase server
run: |
sudo mkdir -p /usr/src/showcase
sudo chown -R ${USER} /usr/src/
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
cd /usr/src/showcase/
tar -xf showcase-*
./gapic-showcase run &
cd -

- name: Showcase integration tests
run: mvn verify -P showcase
64 changes: 2 additions & 62 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
go-version: '^1.13.1'
- name: License Header Check
run: |
go install github.com/google/addlicense@latest
addlicense -c "Google LLC" -l apache -check $(find $PWD -type f -name '*.java' ! -iname '*PlaceholderFile.java')

go install github.com/google/addlicense@latest
addlicense -c "Google LLC" -l apache -ignore showcase/** -check $(find $PWD -type f -name '*.java' ! -iname '*PlaceholderFile.java')
build:
needs: license-header
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,62 +106,3 @@ jobs:
- name: Generate Code Coverage Report
# Run only test targets, and not golden_update targets.
run: bazel coverage //:units --combined_report=lcov

showcase:
# needs: build
runs-on: ubuntu-latest
# services:
# showcase-server:
# image: gcr.io/gapic-images/gapic-showcase:0.25.0
# ports:
# - "7469:7469"
strategy:
matrix:
java: [ 8, 11 ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: temurin
- run: java -version

- name: Bazel File Cache Setup
id: cache-bazel
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}

- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
echo "No cache found."
- name: Bazel Cache Found
if: steps.cache-bazel.outputs.cache-hit == 'true'
run: |
echo -n "Cache found. Cache size: "
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the CACHE_VERSION secret in"
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
echo "(use any random string, any GUID will work)"
echo "and it will start over with a clean cache."
echo "The old one will disappear after 7 days."

- name: Install system dependencies.
run: |
sudo apt-get update
sudo apt-get install -y curl unzip

- name: Install showcase
run: |
sudo mkdir -p /usr/src/showcase
sudo chown -R ${USER} /usr/src/
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz
cd /usr/src/showcase/
tar -xf showcase-*
./gapic-showcase run &
cd -

- name: Showcase Integration Testing
run: bazel --batch test //test/showcase/...
16 changes: 15 additions & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: SonarCloud Build

on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
build:
name: Build
Expand All @@ -13,25 +15,37 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
- run: java -version
- run: mvn -version

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=googleapis_gapic-generator-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io
run: |
mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-B \
-Dsonar.verbose=true \
-Dsonar.projectKey=googleapis_gapic-generator-java \
-Dsonar.organization=googleapis \
-Dsonar.host.url=https://sonarcloud.io
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
bazel-*
.gradle/
target/
.flattened-pom.xml

# IDE
.idea
.ijwb
*.iml

# Vim.
*.sw*
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [2.11.0](https://github.com/googleapis/gapic-generator-java/compare/v2.10.3...v2.11.0) (2022-11-30)


### Features

* **ast:** Array expressions ([#1080](https://github.com/googleapis/gapic-generator-java/issues/1080)) ([bd9532c](https://github.com/googleapis/gapic-generator-java/commit/bd9532c6663f2e8f9d9978cd0a3cffde821960ec))


### Bug Fixes

* **ast:** Add import generation for annotations on VariableExpr ([#1076](https://github.com/googleapis/gapic-generator-java/issues/1076)) ([f5d5524](https://github.com/googleapis/gapic-generator-java/commit/f5d5524e626f26ef53d4ae6c02118ef70ace205a))
* **deps:** Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#1088](https://github.com/googleapis/gapic-generator-java/issues/1088)) ([0e75338](https://github.com/googleapis/gapic-generator-java/commit/0e75338dcb083c4cccd35d8682ba9cbe4e314ef8))
* Support testing nested argument method signatures and 'double' field assertions ([#1094](https://github.com/googleapis/gapic-generator-java/issues/1094)) ([4bf419f](https://github.com/googleapis/gapic-generator-java/commit/4bf419f764e2ecfdac9caf03968f40a8cd564655))

## [2.10.3](https://github.com/googleapis/gapic-generator-java/compare/v2.10.2...v2.10.3) (2022-11-01)


Expand Down
21 changes: 19 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@
bazel run //test/integration:update_redis
```

### Golden Showcase Testing

- Regenerate the showcase client into the `./showcase` projects.

```shell
mvn compile -P update-showcase
# or, for backward compatibility with previous workflows:
mvn compile -D updateUnitGoldens
```

- Run a test to verify a newly generated showcase client is identical to the golden files
in `./showcase`.

```shell
mvn verify -P showcase-golden
```

## Showcase Integration Testing

[GAPIC Showcase](https://github.com/googleapis/gapic-showcase) is an API that demonstrates Generated
Expand Down Expand Up @@ -159,10 +176,10 @@ $ gapic-showcase run

### Running the Integration Tests

Open a new terminal window and run all tests in the `/test/showcase` directory.
Open a new terminal window in the root project directory.

```shell
$ bazel test //test/showcase/...
$ mvn verify -P showcase
```

## Running the Plugin
Expand Down
3 changes: 3 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ http_archive(
# Showcase
_showcase_commit = "90d73532a0cab753a85f45c158394f24fc21d91a"

_showcase_sha256 = "0f582541a379be0746e6b8bc5af3df511581d4b1f18f7dfb9ce203be1a64cef1"

http_archive(
name = "com_google_gapic_showcase",
sha256 = _showcase_sha256,
strip_prefix = "gapic-showcase-%s" % _showcase_commit,
urls = [
# "https://github.com/googleapis/gapic-showcase/archive/refs/tags/v%s.zip" % _showcase_version,
Expand Down
43 changes: 43 additions & 0 deletions coverage/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java-coverage-aggregate</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Aggregate Coverage Report</name>

<dependencies>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gapic-generator-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gapic-showcase</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading