From 338e5650e10430c165ceed3d2dd57db8e2b42872 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Tue, 30 Nov 2021 15:31:14 -0800 Subject: [PATCH 01/32] chore: migrate to github actions (#133) --- .codeclimate.yml | 88 ------------------- .github/workflows/release.yml | 50 +++++++++++ .github/workflows/test.yml | 50 +++++++++++ .maven.xml | 24 ----- .travis.yml | 28 ------ README.md | 2 +- .../com/sendgrid/TestRequiredFilesExist.java | 9 -- 7 files changed, 101 insertions(+), 150 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .maven.xml delete mode 100644 .travis.yml diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index c84b2ee..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,88 +0,0 @@ -# This is a sample .codeclimate.yml configured for Engine analysis on Code -# Climate Platform. For an overview of the Code Climate Platform, see here: -# http://docs.codeclimate.com/article/300-the-codeclimate-platform - -# Under the engines key, you can configure which engines will analyze your repo. -# Each key is an engine name. For each value, you need to specify enabled: true -# to enable the engine as well as any other engines-specific configuration. - -# For more details, see here: -# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform - -# For a list of all available engines, see here: -# http://docs.codeclimate.com/article/296-engines-available-engines - -#engines: -# to turn on an engine, add it here and set enabled to `true` -# to turn off an engine, set enabled to `false` or remove it -# rubocop: -# enabled: true -# golint: -# enabled: true -# gofmt: -# enabled: true -# eslint: -# enabled: true -# csslint: -# enabled: true - -# Engines can analyze files and report issues on them, but you can separately -# decide which files will receive ratings based on those issues. This is -# specified by path patterns under the ratings key. - -# For more details see here: -# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform - -# ratings: -# paths: -# - app/** -# - lib/** -# - "**.rb" -# - "**.go" - -# You can globally exclude files from being analyzed by any engine using the -# exclude_paths key. - -#All maintainability checks are enabled by default with the following configurations. -#checks, -# argument-count: -# config: -# threshold: 4 -# complex-logic: -# config: -# threshold: 4 -# file-lines: -# config: -# threshold: 250 -# method-complexity: -# config: -# threshold: 5 -# method-count: -# config: -# threshold: 20 -# method-lines: -# config: -# threshold: 25 -# nested-control-flow: -# config: -# threshold: 4 -# return-statements: -# config: -# threshold: 4 -# similar-code: -# config: -# threshold: # language-specific defaults. an override will affect all languages. -# identical-code: -# config: -# threshold: # language-specific defaults. an override will affect all languages. - -engines: - sonar-java: - enabled: true - channel: beta - -exclude_paths: -- "scripts/" -- ".github/" -- "gradle/" -- "**/test/" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d4317b9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Sonatype Maven + uses: actions/setup-java@v2 + with: + java-version: 8 + distribution: temurin + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + - name: Publish to Maven + env: + MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: mvn clean deploy -DskipTests=true -B -U -Prelease + + notify-on-failure: + name: Slack notify on failure + if: ${{ failure() }} + needs: [release] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} + SLACK_TITLE: Release Failure + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c985db3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,50 @@ +name: Tests +on: + push: + branches: [ '*' ] + pull_request: + branches: [ main ] + schedule: + # Run automatically at 8AM PST Monday-Friday + - cron: '0 15 * * 1-5' + workflow_dispatch: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + + - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + - name: Run Unit Tests + run: mvn test -B + + notify-on-failure: + name: Slack notify on failure + if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: ${{ needs.test.status }} + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} + SLACK_TITLE: Build Failure + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/.maven.xml b/.maven.xml deleted file mode 100644 index bef1ab6..0000000 --- a/.maven.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - ossrh - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} - - - - - - ossrh - - true - - - ${env.GPG_EXECUTABLE} - ${env.GPG_PASSPHRASE} - - - - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3fa7c29..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: java -before_install: -- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import --batch || true -- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch || true -jdk: -- openjdk8 -- openjdk11 -install: -- mvn --settings .maven.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true - -B -V -after_success: -- bash <(curl -s https://codecov.io/bash) -t $CODECOV_KEY -deploy: -- provider: script - script: mvn clean deploy --settings .maven.xml -DskipTests=true -B -U -Prelease - skip_cleanup: true - on: - tags: true - jdk: openjdk8 - branch: main -notifications: - slack: - if: branch = main - on_pull_requests: false - on_success: never - on_failure: change - rooms: - secure: jnmSBE28sD/3ZFMDtnBtrxpB4h8aOPmqXJXv7rUQMUflf5+9slbaj8des72QpNAWOJnHjY0MasfKCuQlau9b5iPllJEF3aVswCORFErsLT3U5UW4qolC0MeTygj3g6RQUsrgFxuUxOrDW6OSkFV4gASyrFIqeI+pBj8Xu0YAdxnIJGTAKYQ+c8wLL4uiUgle3id0QRTv6BArezROjAlFpE7S40BCN/ulgVOT1X0gD3HtuXkSscnmnqmWY2UurbHQ3yPcR2xJo75tY6Hf4CxTJAqioVH8ygbboMMFYbzhlfZyGofbz01g5mUNRB6s39AnoxoOhkDJRJY6J3i+xhJBufLN8XxiFyq176ngZJDjCF/pjg5sWDdlmG8pHZawrBEecMOrg29CnuuBzNZpWz1+93cOD4Ak1UtZC5m04+X8oMUx1Q+pjRPdFJYSHXStBBYNV1/aNCNIOFVm6tAN+JgpO6I3aEKI2PMJaxeqUtU931pEzz/48DJYCHIsL7ZSDopPjenPck6UfhrwE4fubzwfac8JVnwTGKqENlVChPP7jMTb8tK2a2RpMel7PMrriTUm+RMoEFi8x2wntPm9CdqQ+bn8VsOppQ2IIOj85d4prcPxfTJMUsKAQh5WRHHT472WxH+OOOFYo6fZLEam+toTmW/zeK8+oCefVy+1SQR8hHk= diff --git a/README.md b/README.md index f7bee96..463f315 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![SendGrid Logo](twilio_sendgrid_logo.png) -[![Build Status](https://travis-ci.com/sendgrid/java-http-client.svg?branch=main)](https://travis-ci.com/sendgrid/java-http-client) +[![BuildStatus](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.sendgrid/java-http-client.svg)](http://mvnrepository.com/artifact/com.sendgrid/java-http-client) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) diff --git a/src/test/java/com/sendgrid/TestRequiredFilesExist.java b/src/test/java/com/sendgrid/TestRequiredFilesExist.java index fa73126..792b209 100644 --- a/src/test/java/com/sendgrid/TestRequiredFilesExist.java +++ b/src/test/java/com/sendgrid/TestRequiredFilesExist.java @@ -29,15 +29,6 @@ public class TestRequiredFilesExist { assertTrue(new File("./.gitignore").exists()); } - // ./.travis.yml - @Test public void checkTravisExists() { - assertTrue(new File("./.travis.yml").exists()); - } - - // ./.codeclimate.yml - @Test public void checkCodeClimateExists() { - assertTrue(new File("./.codeclimate.yml").exists()); - } // ./CHANGELOG.md @Test public void checkChangelogExists() { From d9c77a316bae2ba34667ce40374b78fe2d72a9ce Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Wed, 1 Dec 2021 11:52:12 -0800 Subject: [PATCH 02/32] chore: fix pom for release (#135) --- pom.xml | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/pom.xml b/pom.xml index 6ace9b5..7b84d4d 100644 --- a/pom.xml +++ b/pom.xml @@ -27,38 +27,6 @@ 4.3.7 - - gpg - - false - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - ${gpg.keyname} - ${gpg.passphrase} - - --pinentry-mode - loopback - - - - - - release @@ -116,6 +84,14 @@ sign + + ${gpg.keyname} + ${gpg.passphrase} + + --pinentry-mode + loopback + + @@ -240,4 +216,4 @@ - \ No newline at end of file + From 6a8b2e0191c78df50d1a3d0be98a61b9da1d0e65 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 1 Dec 2021 21:10:22 +0000 Subject: [PATCH 03/32] [Librarian] Version Bump --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c22cfe7..a8ea9ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +[2021-12-01] Version 4.3.8 +-------------------------- +**Library - Chore** +- [PR #135](https://github.com/sendgrid/java-http-client/pull/135): fix pom for release. Thanks to [@eshanholtz](https://github.com/eshanholtz)! +- [PR #133](https://github.com/sendgrid/java-http-client/pull/133): migrate to github actions. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + + [2021-05-19] Version 4.3.7 -------------------------- **Library - Chore** From 8436779ca9a3c4c1c0e872b7e518970951711a8e Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 1 Dec 2021 21:12:37 +0000 Subject: [PATCH 04/32] Release 4.3.8 --- README.md | 4 ++-- pom.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 463f315..845bf38 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). ... dependencies { ... - compile 'com.sendgrid:java-http-client:4.3.7' + compile 'com.sendgrid:java-http-client:4.3.8' } repositories { @@ -54,7 +54,7 @@ repositories { com.sendgrid java-http-client - 4.3.7 + 4.3.8 ``` diff --git a/pom.xml b/pom.xml index 7b84d4d..72ff9bf 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ jar A simple HTTP client HTTP REST client, simplified for Java - 4.3.7 + 4.3.8 https://github.com/sendgrid/java-http-client @@ -24,7 +24,7 @@ https://github.com/sendgrid/java-http-client scm:git:git@github.com:sendgrid/java-http-client.git scm:git:git@github.com:sendgrid/java-http-client.git - 4.3.7 + 4.3.8 @@ -216,4 +216,4 @@ - + \ No newline at end of file From 24fc351ebf809a616cfd9acad71df420d2c521a7 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:05:37 -0700 Subject: [PATCH 05/32] chore: update license year (#136) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e5439a9..5db04ff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2021, Twilio SendGrid, Inc. +Copyright (C) 2022, Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 51f1b1567a96a6dd600b7a93fcc998c07995fb7d Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 12 Jan 2022 19:20:18 +0000 Subject: [PATCH 06/32] [Librarian] Version Bump --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8ea9ba..36faf73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +[2022-01-12] Version 4.3.9 +-------------------------- +**Library - Chore** +- [PR #136](https://github.com/sendgrid/java-http-client/pull/136): update license year. Thanks to [@JenniferMah](https://github.com/JenniferMah)! + + [2021-12-01] Version 4.3.8 -------------------------- **Library - Chore** From cccce61fafa2dbf71f2307a188f7cf2b6b1a94f1 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 12 Jan 2022 19:23:58 +0000 Subject: [PATCH 07/32] Release 4.3.9 --- README.md | 4 ++-- pom.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 845bf38..1d0198d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). ... dependencies { ... - compile 'com.sendgrid:java-http-client:4.3.8' + compile 'com.sendgrid:java-http-client:4.3.9' } repositories { @@ -54,7 +54,7 @@ repositories { com.sendgrid java-http-client - 4.3.8 + 4.3.9 ``` diff --git a/pom.xml b/pom.xml index 72ff9bf..e95b166 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ jar A simple HTTP client HTTP REST client, simplified for Java - 4.3.8 + 4.3.9 https://github.com/sendgrid/java-http-client @@ -24,7 +24,7 @@ https://github.com/sendgrid/java-http-client scm:git:git@github.com:sendgrid/java-http-client.git scm:git:git@github.com:sendgrid/java-http-client.git - 4.3.8 + 4.3.9 @@ -119,7 +119,7 @@ org.apache.httpcomponents httpcore - 4.4.14 + 4.4.15 org.apache.httpcomponents From a8d5e4da2d336a2b8e0d81c660d3ed24c46b2c84 Mon Sep 17 00:00:00 2001 From: Mikko Date: Wed, 2 Feb 2022 23:41:52 +0200 Subject: [PATCH 08/32] Support multiple duplicate queryparams (#134) The SendGrid API documentation states that the user can supply up to ten categories, but there is no way to supply them using the Java library. This commit fixes the problem by interpreting any value that has an ampersand in it as a list of values, which will be inserted as multiple query params. For example, the call request.addQueryParam("categories", "cat1&cat2") will output "?categories=cat1&categories=cat2" into the URL. --- README.md | 2 ++ src/main/java/com/sendgrid/Client.java | 15 +++++++++++- src/test/java/com/sendgrid/ClientTest.java | 28 ++++++++++++++++++---- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1d0198d..0c15ca9 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ try { request.addHeader("Authorization", "Bearer YOUR_API_KEY"); request.addQueryParam("limit", "100"); request.addQueryParam("offset", "0"); +// Will be parsed to categories=cake&categories=pie&categories=baking +request.addQueryParam("categories", "cake&pie&baking"); request.setBody("{\"name\": \"My Request Body\"}"); request.setMethod(Method.POST); String param = "param"; diff --git a/src/main/java/com/sendgrid/Client.java b/src/main/java/com/sendgrid/Client.java index 340f12c..d0865fd 100644 --- a/src/main/java/com/sendgrid/Client.java +++ b/src/main/java/com/sendgrid/Client.java @@ -9,6 +9,8 @@ import java.nio.charset.Charset; import java.util.HashMap; import java.util.Map; +import java.util.Arrays; +import java.util.List; import org.apache.http.Header; import org.apache.http.HttpMessage; @@ -129,8 +131,19 @@ public URI buildUri(String baseUri, String endpoint, Map queryPa builder.setPath(endpoint); if (queryParams != null) { + String multiValueDelimiter = "&"; + for (Map.Entry entry : queryParams.entrySet()) { - builder.setParameter(entry.getKey(), entry.getValue()); + String value = entry.getValue(); + + if (value.indexOf(multiValueDelimiter) != -1) { + List values = Arrays.asList(value.split(multiValueDelimiter)); + for (String val : values) { + builder.addParameter(entry.getKey(), val); + } + } else { + builder.setParameter(entry.getKey(), entry.getValue()); + } } } diff --git a/src/test/java/com/sendgrid/ClientTest.java b/src/test/java/com/sendgrid/ClientTest.java index 9367379..0425199 100644 --- a/src/test/java/com/sendgrid/ClientTest.java +++ b/src/test/java/com/sendgrid/ClientTest.java @@ -33,8 +33,10 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; +import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URL; import java.util.HashMap; import java.util.Map; @@ -62,6 +64,7 @@ public void testbuildUri() { Map queryParams = new HashMap(); queryParams.put("test1", "1"); queryParams.put("test2", "2"); + queryParams.put("test3", "3&4&5"); try { uri = client.buildUri(baseUri, endpoint, queryParams); } catch (URISyntaxException ex) { @@ -70,10 +73,23 @@ public void testbuildUri() { Assert.assertTrue(errors.toString(), false); } - String url = uri.toString(); - System.out.println(url); - Assert.assertTrue(url.equals("https://api.test.com/endpoint?test2=2&test1=1") || - url.equals("https://api.test.com/endpoint?test1=1&test2=2")); + URL url = null; + try { + url = uri.toURL(); + } catch (MalformedURLException ex) { + StringWriter errors = new StringWriter(); + ex.printStackTrace(new PrintWriter(errors)); + Assert.assertTrue(errors.toString(), false); + } + + Assert.assertTrue(url.getProtocol().equals("https")); + Assert.assertTrue(url.getHost().equals("api.test.com")); + Assert.assertTrue(url.getPath().equals("/endpoint")); + Assert.assertTrue(this.queryParamHasCorrectValue(url, "test1", "1")); + Assert.assertTrue(this.queryParamHasCorrectValue(url, "test2", "2")); + Assert.assertTrue(this.queryParamHasCorrectValue(url, "test3", "3")); + Assert.assertTrue(this.queryParamHasCorrectValue(url, "test3", "4")); + Assert.assertTrue(this.queryParamHasCorrectValue(url, "test3", "5")); } @Test @@ -174,4 +190,8 @@ public void testPut() { public void testDelete() { testMethod(Method.DELETE, 204); } + + private boolean queryParamHasCorrectValue(URL url, String key, String value) { + return url.getQuery().indexOf(key + "=" + value) != -1; + } } From c06b8c20cd49f9e4b21b7b13aa49e6261265d05d Mon Sep 17 00:00:00 2001 From: Shwetha Radhakrishna Date: Thu, 3 Feb 2022 14:47:53 -0600 Subject: [PATCH 09/32] chore: merge test and deploy workflows (#137) --- .../{release.yml => test-and-deploy.yml} | 48 ++++++++++++++---- .github/workflows/test.yml | 50 ------------------- README.md | 2 +- 3 files changed, 39 insertions(+), 61 deletions(-) rename .github/workflows/{release.yml => test-and-deploy.yml} (50%) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/test-and-deploy.yml similarity index 50% rename from .github/workflows/release.yml rename to .github/workflows/test-and-deploy.yml index d4317b9..c25ad2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/test-and-deploy.yml @@ -1,13 +1,41 @@ -name: Release +name: Test and Deploy on: push: - tags: - - '*' + branches: [ '*' ] + tags: [ '*' ] + pull_request: + branches: [ main ] + schedule: + # Run automatically at 8AM PST Monday-Friday + - cron: '0 15 * * 1-5' workflow_dispatch: jobs: - release: - name: Release + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + + - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + - name: Run Unit Tests + run: mvn test -B + + deploy: + name: Deploy + if: success() && github.ref_type == 'tag' + needs: [ test ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -33,16 +61,16 @@ jobs: notify-on-failure: name: Slack notify on failure - if: ${{ failure() }} - needs: [release] + if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') + needs: [ test, deploy ] runs-on: ubuntu-latest steps: - uses: rtCamp/action-slack-notify@v2 env: - SLACK_COLOR: 'danger' + SLACK_COLOR: failure SLACK_ICON_EMOJI: ':github:' - SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} - SLACK_TITLE: Release Failure + SLACK_MESSAGE: ${{ format('Tests *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} + SLACK_TITLE: Action Failure - ${{ github.repository }} SLACK_USERNAME: GitHub Actions SLACK_MSG_AUTHOR: twilio-dx SLACK_FOOTER: Posted automatically using GitHub Actions diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index c985db3..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Tests -on: - push: - branches: [ '*' ] - pull_request: - branches: [ main ] - schedule: - # Run automatically at 8AM PST Monday-Friday - - cron: '0 15 * * 1-5' - workflow_dispatch: - -jobs: - test: - name: Test - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - matrix: - java: [8, 11] - steps: - - uses: actions/checkout@v2 - - - name: Set up Java - uses: actions/setup-java@v2 - with: - distribution: 'temurin' - java-version: ${{ matrix.java }} - cache: 'maven' - - - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V - - name: Run Unit Tests - run: mvn test -B - - notify-on-failure: - name: Slack notify on failure - if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} - needs: [test] - runs-on: ubuntu-latest - steps: - - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_COLOR: ${{ needs.test.status }} - SLACK_ICON_EMOJI: ':github:' - SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }} - SLACK_TITLE: Build Failure - SLACK_USERNAME: GitHub Actions - SLACK_MSG_AUTHOR: twilio-dx - SLACK_FOOTER: Posted automatically using GitHub Actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - MSG_MINIMAL: true diff --git a/README.md b/README.md index 0c15ca9..90e8d1b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![SendGrid Logo](twilio_sendgrid_logo.png) -[![BuildStatus](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml/badge.svg)](https://github.com/sendgrid/java-http-client/actions/workflows/test.yml) +[![Test and Deploy](https://github.com/sendgrid/java-http-client/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/java-http-client/actions/workflows/test-and-deploy.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.sendgrid/java-http-client.svg)](http://mvnrepository.com/artifact/com.sendgrid/java-http-client) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) From 124fdab301af76c2110f7beec8e230e4eeea9354 Mon Sep 17 00:00:00 2001 From: Shwetha Radhakrishna Date: Thu, 3 Feb 2022 16:57:41 -0600 Subject: [PATCH 10/32] chore: add gh release to workflow (#138) * chore: add gh release to workflow --- .github/workflows/test-and-deploy.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index c25ad2d..f256032 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -51,7 +51,17 @@ jobs: gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} gpg-passphrase: GPG_PASSPHRASE - - run: mvn install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + - name: Install Dependencies + run: make install + + - name: Create GitHub Release + uses: sendgrid/dx-automator/actions/release@main + with: + assets: java-http-client.jar + footer: '**[Maven](https://mvnrepository.com/artifact/com.sendgrid/java-http-client/${version})**' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish to Maven env: MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} From 496c97828bbc33b8090cd97a51fd105e90a65d8c Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Fri, 4 Feb 2022 10:04:32 -0600 Subject: [PATCH 11/32] chore: make Slack message consistent across all repos --- .github/workflows/test-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index f256032..26660a8 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -79,7 +79,7 @@ jobs: env: SLACK_COLOR: failure SLACK_ICON_EMOJI: ':github:' - SLACK_MESSAGE: ${{ format('Tests *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} + SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} SLACK_TITLE: Action Failure - ${{ github.repository }} SLACK_USERNAME: GitHub Actions SLACK_MSG_AUTHOR: twilio-dx From 12fd4828a7f7562e14a5a40b67b0d94b188f9987 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Tue, 8 Feb 2022 11:11:46 -0600 Subject: [PATCH 12/32] chore: upgrade supported language versions (#139) --- .github/workflows/test-and-deploy.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 26660a8..7450708 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - java: [8, 11] + java: [ 8, 11, 17 ] steps: - uses: actions/checkout@v2 @@ -43,7 +43,7 @@ jobs: - name: Set up Sonatype Maven uses: actions/setup-java@v2 with: - java-version: 8 + java-version: 17 distribution: temurin server-id: ossrh server-username: MAVEN_USERNAME diff --git a/README.md b/README.md index 90e8d1b..59a7e5d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). ## Prerequisites -- Java 8 or 11 +- Java 8, 11, or 17 ## Install via Maven w/ Gradle From 55b77e4991a3bcb432b6b21347ade316aceeec37 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Feb 2022 23:50:25 +0000 Subject: [PATCH 13/32] [Librarian] Version Bump --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36faf73..ebef906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +[2022-02-09] Version 4.4.0 +-------------------------- +**Library - Chore** +- [PR #139](https://github.com/sendgrid/java-http-client/pull/139): upgrade supported language versions. Thanks to [@childish-sambino](https://github.com/childish-sambino)! +- [PR #138](https://github.com/sendgrid/java-http-client/pull/138): add gh release to workflow. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! +- [PR #137](https://github.com/sendgrid/java-http-client/pull/137): merge test and deploy workflows. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)! + +**Library - Feature** +- [PR #134](https://github.com/sendgrid/java-http-client/pull/134): Support multiple duplicate queryparams. Thanks to [@mjjs](https://github.com/mjjs)! + + [2022-01-12] Version 4.3.9 -------------------------- **Library - Chore** From 138a0db78c8fc9c4ca0f65f66dd8d767e5975401 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Feb 2022 23:51:00 +0000 Subject: [PATCH 14/32] Release 4.4.0 --- README.md | 4 ++-- pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 59a7e5d..e2525ee 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). ... dependencies { ... - compile 'com.sendgrid:java-http-client:4.3.9' + compile 'com.sendgrid:java-http-client:4.4.0' } repositories { @@ -54,7 +54,7 @@ repositories { com.sendgrid java-http-client - 4.3.9 + 4.4.0 ``` diff --git a/pom.xml b/pom.xml index e95b166..21c1e88 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ jar A simple HTTP client HTTP REST client, simplified for Java - 4.3.9 + 4.4.0 https://github.com/sendgrid/java-http-client @@ -24,7 +24,7 @@ https://github.com/sendgrid/java-http-client scm:git:git@github.com:sendgrid/java-http-client.git scm:git:git@github.com:sendgrid/java-http-client.git - 4.3.9 + 4.4.0 From 98f55e32f02e30481ff734af35552ed2c1adcc28 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Wed, 9 Feb 2022 16:57:12 -0800 Subject: [PATCH 15/32] fix: fix deployment to maven --- pom.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 21c1e88..07fd2b8 100644 --- a/pom.xml +++ b/pom.xml @@ -104,6 +104,16 @@ 1.8 + + + com.thoughtworks.xstream + xstream + 1.4.15 + junit junit-dep @@ -216,4 +226,4 @@ - \ No newline at end of file + From e975850aa901ef117f58e7b45c2ad60693153325 Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Wed, 9 Feb 2022 17:14:38 -0800 Subject: [PATCH 16/32] fix: fix twilio-php docs --- pom.xml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 07fd2b8..9b2ebef 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,18 @@ https://oss.sonatype.org/ true + + + + com.thoughtworks.xstream + xstream + 1.4.15 + + org.apache.maven.plugins @@ -104,16 +116,6 @@ 1.8 - - - com.thoughtworks.xstream - xstream - 1.4.15 - junit junit-dep From a1d0c6e854aa31517721e012b2a82d2ca893ca50 Mon Sep 17 00:00:00 2001 From: Jennifer Mah Date: Wed, 9 Feb 2022 17:19:35 -0800 Subject: [PATCH 17/32] chore: remove potential fix --- pom.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pom.xml b/pom.xml index 9b2ebef..58e19ba 100644 --- a/pom.xml +++ b/pom.xml @@ -46,18 +46,6 @@ https://oss.sonatype.org/ true - - - - com.thoughtworks.xstream - xstream - 1.4.15 - - org.apache.maven.plugins From 262149b2ba45a72d845b54a4bf4c94ebec61aa67 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 10 Feb 2022 14:17:54 -0600 Subject: [PATCH 18/32] fix: rollback to Java 8 for Sonatype deployment --- .github/workflows/test-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 7450708..d464089 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -43,7 +43,7 @@ jobs: - name: Set up Sonatype Maven uses: actions/setup-java@v2 with: - java-version: 17 + java-version: 8 distribution: temurin server-id: ossrh server-username: MAVEN_USERNAME From 779951837591c527083a62b698fdfd40bedba8c9 Mon Sep 17 00:00:00 2001 From: Jennifer Mah <42650198+JenniferMah@users.noreply.github.com> Date: Thu, 24 Feb 2022 14:19:21 -0800 Subject: [PATCH 19/32] feat: add GH action to update dependencies (#141) --- .github/workflows/update-dependencies.yml | 58 +++++++++++++++++++++++ Makefile | 5 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-dependencies.yml diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml new file mode 100644 index 0000000..0dd69a7 --- /dev/null +++ b/.github/workflows/update-dependencies.yml @@ -0,0 +1,58 @@ +name: Update dependencies +on: + schedule: + # Run automatically at 7AM PST Tuesday + - cron: '0 14 * * 2' + workflow_dispatch: + +jobs: + update-dependencies-and-test: + name: Update Dependencies & Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + max-parallel: 1 + matrix: + java: [ 8, 11, 17 ] + + steps: + - name: Checkout java-http-client + uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Updating semver dependencies + run: make update-deps + + - run: mvn install -Dgpg.skip -Dmaven.javadoc.skip=true -B -V + + - name: Add & Commit + if: matrix.java == '17' + uses: EndBug/add-and-commit@v8.0.2 + with: + add: 'pom.xml' + default_author: 'github_actions' + message: 'chore: update java-http-client dependencies' + + notify-on-failure: + name: Slack notify on failure + if: failure() + needs: [ update-dependencies-and-test ] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: failure + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Update dependencies *{0}*, {1}/{2}/actions/runs/{3}', needs.update-dependencies-and-test.result, github.server_url, github.repository, github.run_id) }} + SLACK_TITLE: Action Failure - ${{ github.repository }} + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/Makefile b/Makefile index 3d76197..851986a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: install package test test-integration clean +.PHONY: install package test update-deps test-integration clean VERSION := $(shell mvn help:evaluate -Dexpression=project.version --batch-mode | grep -e '^[^\[]') install: @@ -13,5 +13,8 @@ package: test: mvn test +update-deps: + mvn versions:use-latest-releases versions:commit -DallowMajorUpdates=false + clean: mvn clean From 5da655731414e99ecf8f83fc868b7bbf5a623c09 Mon Sep 17 00:00:00 2001 From: Elise Shanholtz Date: Mon, 28 Feb 2022 12:35:22 -0800 Subject: [PATCH 20/32] chore: push Datadog Release Metric upon deploy success (#142) --- .github/workflows/test-and-deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index d464089..9abc8c2 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -69,6 +69,11 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: mvn clean deploy -DskipTests=true -B -U -Prelease + - name: Submit metric to Datadog + uses: sendgrid/dx-automator/actions/datadog-release-metric@main + env: + DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + notify-on-failure: name: Slack notify on failure if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') From 73aba662547b7d3d492aab8c91a281759a3cac4f Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Mar 2022 12:21:54 -0800 Subject: [PATCH 21/32] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebef906..150eafc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +[2022-03-09] Version 4.5.0 +-------------------------- +**Library - Chore** +- [PR #142](https://github.com/sendgrid/java-http-client/pull/142): push Datadog Release Metric upon deploy success. Thanks to [@eshanholtz](https://github.com/eshanholtz)! + +**Library - Feature** +- [PR #141](https://github.com/sendgrid/java-http-client/pull/141): add GH action to update dependencies. Thanks to [@JenniferMah](https://github.com/JenniferMah)! + + [2022-02-09] Version 4.4.0 -------------------------- **Library - Chore** From 782246b4c70b7688d98d95b867d94f6c773b3927 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 9 Mar 2022 12:21:54 -0800 Subject: [PATCH 22/32] Release 4.5.0 --- README.md | 4 ++-- pom.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e2525ee..c26ede1 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). ... dependencies { ... - compile 'com.sendgrid:java-http-client:4.4.0' + compile 'com.sendgrid:java-http-client:4.5.0' } repositories { @@ -54,7 +54,7 @@ repositories { com.sendgrid java-http-client - 4.4.0 + 4.5.0 ``` diff --git a/pom.xml b/pom.xml index 58e19ba..6cdc6ba 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ jar A simple HTTP client HTTP REST client, simplified for Java - 4.4.0 + 4.5.0 https://github.com/sendgrid/java-http-client @@ -24,7 +24,7 @@ https://github.com/sendgrid/java-http-client scm:git:git@github.com:sendgrid/java-http-client.git scm:git:git@github.com:sendgrid/java-http-client.git - 4.4.0 + 4.5.0 @@ -216,4 +216,4 @@ - + \ No newline at end of file From 4cef06671c23f72dd51c61587c9b5153ff035628 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 24 Mar 2022 10:48:08 -0500 Subject: [PATCH 23/32] chore: remove outdated announcements --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index c26ede1..b174c12 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ If you are looking for the SendGrid API client library, please see [this repo](h # Announcements -**The default branch name for this repository has been changed to `main` as of 07/27/2020.** All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). @@ -60,10 +59,6 @@ repositories { `mvn install` -## Install via Fat Jar - -[sendgrid-java-latest.jar](http://dx.sendgrid.com/downloads/java-http-client/java-http-client-latest.jar) - ## Dependencies - Please see the [pom.xml file](pom.xml) From dc8dc648c90bec259bc6197af3f77b48c843fc25 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Fri, 25 Mar 2022 13:39:49 -0500 Subject: [PATCH 24/32] feat: add PR title validation --- .github/workflows/pr-lint.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pr-lint.yml diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 0000000..8388f21 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,15 @@ +name: Lint PR +on: + pull_request_target: + types: [ opened, edited, reopened ] + +jobs: + validate: + name: Validate title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v4 + with: + types: chore docs fix feat test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From dd508e44f4a5a2b576f753d929b8dc0f9206ae15 Mon Sep 17 00:00:00 2001 From: Bilal Boussayoud Date: Fri, 25 Mar 2022 15:27:45 -0600 Subject: [PATCH 25/32] fix: override default gh token (#143) --- .github/workflows/update-dependencies.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 0dd69a7..35ec8ed 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -34,6 +34,8 @@ jobs: - name: Add & Commit if: matrix.java == '17' uses: EndBug/add-and-commit@v8.0.2 + env: + GITHUB_TOKEN: ${{ secrets.SG_JAVA_GITHUB_TOKEN }} with: add: 'pom.xml' default_author: 'github_actions' From 10f70383d467dbadda96192232d8b23068261a21 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 21 Apr 2022 14:44:33 -0500 Subject: [PATCH 26/32] test: lint PRs on synchronize events Since synchronize events clears the status checks, it needs to be re-run. --- .github/workflows/pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 8388f21..dc7af3d 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -1,7 +1,7 @@ name: Lint PR on: pull_request_target: - types: [ opened, edited, reopened ] + types: [ opened, edited, synchronize, reopened ] jobs: validate: From e98f15c21324ca52cb24fda2479adfa444906835 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Thu, 12 May 2022 10:28:24 -0500 Subject: [PATCH 27/32] chore: drop the issue links from FIRST_TIMERS doc --- FIRST_TIMERS.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/FIRST_TIMERS.md b/FIRST_TIMERS.md index fe354fe..ab29f04 100644 --- a/FIRST_TIMERS.md +++ b/FIRST_TIMERS.md @@ -51,29 +51,3 @@ git push origin ## Important notice Before creating a pull request, make sure that you respect the repository's constraints regarding contributions. You can find them in the [CONTRIBUTING.md](CONTRIBUTING.md) file. - -## Repositories with Open, Easy, Help Wanted, Issue Filters - -* [Python SDK](https://github.com/sendgrid/sendgrid-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP SDK](https://github.com/sendgrid/sendgrid-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# SDK](https://github.com/sendgrid/sendgrid-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby SDK](https://github.com/sendgrid/sendgrid-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Python SMTPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP SMTPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# SMTPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby SMTPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Node.js SMTPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java SMTPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go SMTPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Java HTTP Client](https://github.com/sendgrid/java-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Ruby HTTP Client](https://github.com/sendgrid/ruby-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Go HTTP Client](https://github.com/sendgrid/rest/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Open API Definition](https://github.com/sendgrid/sendgrid-oai/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [DX Automator](https://github.com/sendgrid/dx-automator/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) -* [Documentation](https://github.com/sendgrid/docs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22) From 832502a69e7c960a6045f88cd5ec9d00c62f9bf2 Mon Sep 17 00:00:00 2001 From: "Gareth Paul Jones (GPJ)" Date: Thu, 12 May 2022 11:38:49 -0700 Subject: [PATCH 28/32] docs: Update to align with SendGrid Support (#144) --- .github/ISSUE_TEMPLATE/config.yml | 10 ------- CONTRIBUTING.md | 29 ------------------ ISSUE_TEMPLATE.md | 30 ------------------- README.md | 6 +++- .../com/sendgrid/TestRequiredFilesExist.java | 5 ---- 5 files changed, 5 insertions(+), 75 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 221c533..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -contact_links: - - name: Twilio SendGrid Support - url: https://support.sendgrid.com - about: Get Support - - name: Stack Overflow - url: https://stackoverflow.com/questions/tagged/java-http-client+or+sendgrid+java - about: Ask questions on Stack Overflow - - name: Documentation - url: https://sendgrid.com/docs/for-developers/ - about: View Reference Documentation diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7069100..ff28f44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,5 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open source projects. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies. -- [Feature Request](#feature-request) -- [Submit a Bug Report](#submit-a-bug-report) - [Improvements to the Codebase](#improvements-to-the-codebase) - [Understanding the Code Base](#understanding-the-codebase) - [Testing](#testing) @@ -9,33 +7,6 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou - [Creating a Pull Request](#creating-a-pull-request) - [Code Reviews](#code-reviews) - -## Feature Request - -If you'd like to make a feature request, please read this section. - -The GitHub issue tracker is the preferred channel for library feature requests, but please respect the following restrictions: - -- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests. -- Please be respectful and considerate of others when commenting on issues - - -## Submit a Bug Report - -Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public. - -A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report. - -Before you decide to create a new issue, please try the following: - -1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post. -2. Update to the latest version of this code and check if the issue has already been fixed -3. Copy and fill in the Bug Report Template we have provided below - -### Please use our Bug Report Template - -In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md). - ## Improvements to the Codebase diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index b05b163..0000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,30 +0,0 @@ - - -### Issue Summary -A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples. - -### Steps to Reproduce -1. This is the first step -2. This is the second step -3. Further steps, etc. - -### Code Snippet -```java -# paste code here -``` - -### Exception/Log -``` -# paste exception/log here -``` - -### Technical details: -* java-http-client version: -* java version: - diff --git a/README.md b/README.md index b174c12..c4f940f 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ If you are looking for the SendGrid API client library, please see [this repo](h * [Usage](./USAGE.md) * [How to Contribute](#contribute) * [About](#about) +* [Support](#support) * [License](#license) @@ -129,7 +130,10 @@ Quick links: java-http-client is maintained and funded by Twilio SendGrid, Inc. The names and logos for java-http-client are trademarks of Twilio SendGrid, Inc. -If you need help installing or using the library, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com). + +# Support + +If you need help using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com). If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo! diff --git a/src/test/java/com/sendgrid/TestRequiredFilesExist.java b/src/test/java/com/sendgrid/TestRequiredFilesExist.java index 792b209..02e3d35 100644 --- a/src/test/java/com/sendgrid/TestRequiredFilesExist.java +++ b/src/test/java/com/sendgrid/TestRequiredFilesExist.java @@ -45,11 +45,6 @@ public class TestRequiredFilesExist { assertTrue(new File("./CONTRIBUTING.md").exists()); } - // ./ISSUE_TEMPLATE.md - @Test public void checkIssuesTemplateExists() { - assertTrue(new File("./ISSUE_TEMPLATE.md").exists()); - } - // ./LICENSE @Test public void checkLicenseExists() { assertTrue(new File("./LICENSE").exists()); From 6cffc4e912c5e180c0df481cf084ac43242ee930 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 18 May 2022 13:35:23 -0700 Subject: [PATCH 29/32] [Librarian] Version Bump --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 150eafc..e4a94c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +[2022-05-18] Version 4.5.1 +-------------------------- +**Library - Docs** +- [PR #144](https://github.com/sendgrid/java-http-client/pull/144): Update to align with SendGrid Support. Thanks to [@garethpaul](https://github.com/garethpaul)! + +**Library - Fix** +- [PR #143](https://github.com/sendgrid/java-http-client/pull/143): override default gh token. Thanks to [@beebzz](https://github.com/beebzz)! + + [2022-03-09] Version 4.5.0 -------------------------- **Library - Chore** From 83a9696b3e0b7eb3f92772deadf9ee21f926777a Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 18 May 2022 13:35:23 -0700 Subject: [PATCH 30/32] Release 4.5.1 --- README.md | 4 ++-- pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c4f940f..0f646b8 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ All updates to this project are documented in our [CHANGELOG](CHANGELOG.md). ... dependencies { ... - compile 'com.sendgrid:java-http-client:4.5.0' + compile 'com.sendgrid:java-http-client:4.5.1' } repositories { @@ -54,7 +54,7 @@ repositories { com.sendgrid java-http-client - 4.5.0 + 4.5.1 ``` diff --git a/pom.xml b/pom.xml index 6cdc6ba..efcc8d7 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ jar A simple HTTP client HTTP REST client, simplified for Java - 4.5.0 + 4.5.1 https://github.com/sendgrid/java-http-client @@ -24,7 +24,7 @@ https://github.com/sendgrid/java-http-client scm:git:git@github.com:sendgrid/java-http-client.git scm:git:git@github.com:sendgrid/java-http-client.git - 4.5.0 + 4.5.1 From 6540eda398f109c24f32dc0436559c9471ec9ecc Mon Sep 17 00:00:00 2001 From: Raghav Katyal Date: Wed, 6 Jul 2022 16:14:46 -0700 Subject: [PATCH 31/32] Adding misc as PR type (#145) --- .github/workflows/pr-lint.yml | 2 +- PULL_REQUEST_TEMPLATE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index dc7af3d..2f5232b 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: amannn/action-semantic-pull-request@v4 with: - types: chore docs fix feat test + types: chore docs fix feat test misc env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 593da34..bc85492 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ We appreciate the effort for this pull request but before that please make sure Please format the PR title appropriately based on the type of change: [!]: -Where is one of: docs, chore, feat, fix, test. +Where is one of: docs, chore, feat, fix, test, misc. Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature). **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.** From 956969baa6ae17ab326e818e1bf9a367e23b8c80 Mon Sep 17 00:00:00 2001 From: Sam Harrison Date: Tue, 3 Jan 2023 09:09:30 -0600 Subject: [PATCH 32/32] docs: updated the year in the license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5db04ff..3154774 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2022, Twilio SendGrid, Inc. +Copyright (C) 2023, Twilio SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in