diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index d7fdb5f94..045b85056 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -1,3 +1,4 @@ +--- name: daily on: schedule: @@ -19,8 +20,8 @@ jobs: - core+ext/openjdk17/pg-15 - core+ext/openjdk11/pg-11 - branch: [7.x, main] - os: [ubuntu-20.04] + branch: main + os: [ubuntu-24.04] ruby: ['3.2'] # Defaults for special-case influencing vars @@ -30,47 +31,20 @@ jobs: # Special cases include: - - os: ubuntu-20.04 + - os: ubuntu-24.04 ruby: '3.2' flavor: core+ext/openjdk11/pg-16 drop-joins: by-request - - os: ubuntu-20.04 + - os: ubuntu-24.04 ruby: '3.2' flavor: core+ext/openjdk11/pg-16 lein-profile: fips # non-rich variants for main - - os: ubuntu-20.04 + - os: ubuntu-24.04 branch: main ruby: '3.2' flavor: int/openjdk11/pup-main/srv-main/pg-16 - - os: ubuntu-20.04 - branch: main - ruby: '2.7' - flavor: int/openjdk11/pup-7.x/srv-7.x/pg-16 - - # non-rich variants for 7.x - - os: ubuntu-20.04 - branch: 7.x - ruby: '2.5' - flavor: int/openjdk11/pup-6.x/srv-6.x/pg-11 - - os: ubuntu-20.04 - branch: 7.x - ruby: '2.7' - flavor: int/openjdk11/pup-7.x/srv-7.x/pg-11 - - # OpenJDK 8 testing, only on 7.x - - os: ubuntu-20.04 - branch: 7.x - ruby: '2.7' - flavor: core+ext/openjdk8/pg-11 - - # Test deprecated streaming on 7.x - - os: ubuntu-20.04 - branch: 7.x - ruby: '2.7' - flavor: core+ext/openjdk11/pg-11 - deprecated-query-streaming: 'by-request' steps: - name: Compute job outputs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0523c439..76119652e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,10 @@ +--- name: main -on: [push, pull_request] +on: + pull_request: {} + push: + branches: + - main jobs: # We use "o" as the name to keep it short since the flavor repeats @@ -21,7 +26,7 @@ jobs: - rspec/pup-main - lint/openjdk17 - os: [ubuntu-20.04] + os: [ubuntu-24.04] ruby: ['3.2'] # Defaults for special-case influencing vars @@ -32,11 +37,8 @@ jobs: include: # integration - flavor: int/openjdk17/pup-main/srv-main/pg-16/rich - os: ubuntu-20.04 + os: ubuntu-24.04 ruby: '3.2' - - flavor: int/openjdk17/pup-7.x/srv-7.x/pg-14/rich - os: ubuntu-20.04 - ruby: '2.7' steps: - name: Compute job outputs diff --git a/ci/README.md b/ci/README.md index 065690cf6..29550c2eb 100644 --- a/ci/README.md +++ b/ci/README.md @@ -131,14 +131,8 @@ Prepares the CI machine for tests and runs tests using `ci/bin/run`. ### `ci/bin/run` Runs tests on a prepared CI machine. -### `ci/bin/travis-on-success` -Runs when FOSS PDB Travis tests succeed. Triggers tests on same branch name for extensions repo. Referenced in `.travis.yml`. - ## CI Configuration -### `.travis.yml` -Travis CI configuration. Main CI test runner. Runs core, external, integration, rspec, and container tests in a variety of forms. Notifies Slack with results. See https://travis-ci.com/puppetlabs/puppetdb. - ### `.github/workflows/main.yml` On pull request and push runs core, external, integration, and rspec tests on MacOS machines. Also runs lint test on an Ubuntu machine. @@ -151,9 +145,6 @@ On push to `doc-latest` or `doc-6.y` builds and uploads docs to Puppet's s3 buck ### `.github/workflows/snyk.yml` On push to `6.x` and `main`, run Snyk security scanning tests. -## Internal Jenkins CI Configuration -Both FOSS PuppetDB and PuppetDB Extensions repos are tested with other Puppet Enterprise components internally using a [private Jenkins instance](https://jenkins-enterprise.delivery.puppetlabs.net/view/puppetdb). The CI jobs are defined by [Jenkins Job Builder](https://jenkins-job-builder.readthedocs.io/en/latest) YAML files. They live in the [private ci-job-configs repo](https://github.com/puppetlabs/ci-job-configs). The most important PuppetDB files in that repo are: - ### `doc/pipelines/enterprise.md` Overview of whole Jenkins setup. Documents global parameters which can be used by any project. diff --git a/ci/bin/prep-and-run-in b/ci/bin/prep-and-run-in index 48f34926d..bf079b940 100755 --- a/ci/bin/prep-and-run-in +++ b/ci/bin/prep-and-run-in @@ -13,30 +13,6 @@ test $# -eq 2 || misuse host_type="$1" spec="$2" -# If running on a MacOS instance in Travis... -if [ "$host_type" = travis ] && [[ "$OSTYPE" != darwin* ]]; then - # Workaround for mongodb, CouchDB and git-lfs having invalid keys - # see: https://github.com/travis-ci/travis-ci/issues/9037 (which - # is still broken) - sudo -i rm -f /etc/apt/sources.list.d/mongodb* - sudo -i rm -f /etc/apt/sources.list.d/couchdb* - sudo -i apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 762E3157 - - # See https://github.com/pyenv/pyenv/issues/789 When using the - # system python pyenv prepends /usr/bin to the path which breaks - # anything that tries to override system defaults, like rvm/rbenv - pyenv global 3.7.13 - - # Have to purge some of the existing pg bits so the 11 install - # won't fail with errors like this: - # Refused to start PostgreSQL 11, because PostgreSQL 9.2 is - # currently running! You should first stop 9.2 instance... - # Not sure we have to purge *all* of these, but it works. - sudo -i apt-get purge \ - postgresql{,-client}-{9.2,9.3,9.4,9.5,9.6} \ - postgresql-client-common postgresql-client postgresql-common -fi - # If machine has apt-get, prepare a Debian environment if command -v apt-get > /dev/null; then cmd=$(printf 'cd %q && ext/bin/prep-debianish-root --for %q --install ci/local' \ diff --git a/ci/bin/travis-on-success b/ci/bin/travis-on-success deleted file mode 100755 index dbf508739..000000000 --- a/ci/bin/travis-on-success +++ /dev/null @@ -1,70 +0,0 @@ -"""": # -*-python-*- -command -v python3 > /dev/null && exec python3 "$0" "$@" -command -v python2 > /dev/null && exec python2 "$0" "$@" -echo "error: unable to find python3 or python2" 1>&2; exit 2 -""" - -# Runs when FOSS PDB Travis tests succeed. -# Triggers tests on same branch name for extensions repo. - -from __future__ import print_function -from os import environ -from pipes import quote -from pprint import pprint -from subprocess import check_call, check_output -from sys import exit, stderr -import json, urllib - -cmdurl = 'https://api.travis-ci.com/repo/puppetlabs%2Fpe-puppetdb-extensions' - -# https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables -repo_owner, repo_name = environ['TRAVIS_REPO_SLUG'].split('/', 2) -if repo_owner, repo_name != ('puppetlabs', 'puppetdb'): - exit(0) - -token = environ['PDB_EXT_TRAVIS_TOKEN'] - -def exo(cmd): - print(' '.join(quote(arg) for arg in cmd), file=stderr) - return check_output(cmd) - -def travis_get(path): - global cmdurl, token - return exo(('curl', '-sS', - '-H', 'Accept: application/json', - '-H', 'Travis-API-Version: 3', - '-H', 'Authorization: token ' + token, - cmdurl + path)) - -def travis_post(path, body): - global cmdurl, token - cmd = ('curl', '-sS', - '-H', 'Content-Type: application/json', - '-H', 'Accept: application/json', - '-H', 'Travis-API-Version: 3', - '-H', 'Authorization: token ' + token, - '-d', json.dumps(body), - cmdurl + path) - print(' '.join(quote(arg) for arg in cmd), file=stderr) - check_call(cmd) - -def extensions_branch_exists(branch): - info = json.loads(travis_get('/branch/' + urllib.quote(branch))) - if info.get('@type') == 'error': - if info['error_type'] == 'not_found': - return False - pprint(info, file=stderr) - raise Exception('unexpected error response') - assert(info['@type'] == 'branch') - return True - - -# See if travis knows about a branch with the same name in extensions, -# and if so, kick off a build of the tip. - -current_branch = exo(('git', 'rev-parse', '--abbrev-ref', 'HEAD'))[:-1] -if extensions_branch_exists(current_branch): - travis_post('/requests', {"request" : {"branch" : current_branch}}) -else: - print('No %r branch in extensions, not requesting tests' % current_branch, - file=stderr)