message: Add supported_versions helper

diff:
@@ -6,6 +6,7 @@ Gemfile:
- gem: 'zabbixapi'
spec/spec_helper.rb:
mock_with: ':mocha'
+ spec_overrides: "require 'support/acceptance/supported_versions'"
spec/spec_helper_acceptance.rb:
unmanaged: false
.github/workflows/ci.yml:

diff:
require 'spec_helper_acceptance'
-['4.0', '5.0', '5.2'].each do |version|
+supported_versions.each do |version|
describe "zabbix::agent class with zabbix_version #{version}" do
it 'works idempotently with no errors' do
pp = <<-EOS

diff:
require 'spec_helper_acceptance'
-
describe 'zabbix::server class' do
context 'default parameters' do
# Using puppet_apply as a helper

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
+
describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
# 5.2 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
# Application API was removed in Zabbix 5.4

diff:
@@ -3,7 +3,7 @@ require 'serverspec_type_zabbixapi'
# rubocop:disable RSpec/LetBeforeExamples
describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
# 5.2 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
context "create zabbix_host resources with zabbix version #{zabbix_version}" do

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
+
describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
# 5.2 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
context "create zabbix_hostgroup resources with zabbix version #{zabbix_version}" do

diff:
@@ -3,7 +3,7 @@ require 'serverspec_type_zabbixapi'
# rubocop:disable RSpec/LetBeforeExamples
describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
# 5.2 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
context "create zabbix_proxy resources with zabbix version #{zabbix_version}" do

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
+
describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
# 5.2 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
context "create zabbix_template_host resources with zabbix version #{zabbix_version}" do

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
+
describe 'zabbix_template type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
# 5.2 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
context "create zabbix_template resources with zabbix version #{zabbix_version}" do

diff:
@@ -24,7 +24,7 @@ describe 'zabbix::database::mysql' do
# path to sql files on zabbix 3.X on Debian and RedHat
path = '/usr/share/doc/zabbix-*-mysql*'
- %w[4.0 5.0 5.2].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
context "when zabbix_type is server and zabbix version is #{zabbix_version}" do
describe 'and database_port is defined' do
let :params do

diff:
@@ -13,7 +13,7 @@ describe 'zabbix::web' do
end
on_supported_os.each do |os, facts|
- %w[4.0 5.0].each do |zabbix_version|
+ supported_versions.each do |zabbix_version|
next if facts[:os]['name'] == 'windows'
next if facts[:os]['name'] == 'Archlinux'
next if facts[:os]['name'] == 'Gentoo'

diff:
@@ -20,3 +20,5 @@ if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
end
end
end
+
+require 'support/acceptance/supported_versions'

change_type: ADD

diff:
+def supported_versions
+ %w[4.0 5.0 5.2 5.4]
+end

original_message:
Add supported_versions helper

Signed-off-by: Christos Papageorgiou <root.expert.xda@gmail.com>


change_type: MODIFY

diff:
@@ -366,7 +366,7 @@ class zabbix::web (
}
'CentOS', 'RedHat': {
$zabbix_web_package = 'zabbix-web'
- if ($facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5') >= 0) {
+ if ($facts['os']['release']['major'] == '7' and versioncmp($zabbix_version, '5.0') >= 0) {
package { 'zabbix-required-scl-repo':
ensure => 'latest',
name => 'centos-release-scl',

diff:
@@ -80,7 +80,7 @@ describe 'zabbix::web' do
packages = if facts[:osfamily] == 'RedHat'
if facts[:operatingsystemmajrelease].to_i == 7 &&
!%w[VirtuozzoLinux OracleLinux Scientific].include?(facts[:os]['name']) &&
- zabbix_version == '5.0'
+ zabbix_version =~ %r{5\.[024]}
['zabbix-web-pgsql-scl', 'zabbix-web']
else
['zabbix-web-pgsql', 'zabbix-web']

license: Apache License 2.0

repo: voxpupuli/puppet-zabbix

original_message:
RHEL7 needs scl packages and on 5.4 version

Signed-off-by: Christos Papageorgiou <root.expert.xda@gmail.com>


message: Drop Reference from README

diff:
* [zabbix-userparameters](#usage-zabbix-userparameters)
* [zabbix-template](#usage-zabbix-template)
6. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
- * [zabbix-server](#reference-zabbix-server)
- * [zabbix-agent](#reference-zabbix-agent)
- * [zabbix-proxy](#reference-zabbix-proxy)
- * [zabbix-javagateway](#reference-zabbix-javagateway)
- * [zabbix-userparameters](#reference-zabbix-userparameters)
- * [zabbix-template](#reference-zabbix-template)
7. [Limitations - OS compatibility, etc.](#limitations)
8. [Development - Contributors](#contributors)
9. [Notes](#note)
@@ -407,125 +401,12 @@ class{'zabbix::agent':
zabbix_package_state => 'latest',
}
```
-
## Reference
-There are some overall parameters which exists on all of the classes:
-* `zabbix_version`: You can specify which zabbix release needs to be installed. Default is '3.0'.
-* `manage_firewall`: Wheter you want to manage the firewall. If true, iptables will be configured to allow communications to zabbix ports. (Default: False)
-* `manage_repo`: If zabbix needs to be installed from the zabbix repositories (Default is true). When you have your own repositories, you'll set this to false. But you'll have to make sure that your repository is installed on the host.
-
-The following is only availabe for the following classes: zabbix::web, zabbix::proxy & zabbix::agent
-* `manage_resources`: As of release 0.4.0, when this parameter is set to true (Default is false) it make use of exported resources. You'll have an puppetdb configured before you can use this option. Information from the zabbix::agent, zabbix::proxy and zabbix::userparameters are able to export resources, which will be loaded on the zabbix::server.
-* `database_type`: Which database is used for zabbix. Default is postgresql.
-* `manage_database`: When the parameter 'manage_database' is set to true (Which is default), it will create the database and loads the sql files. Default the postgresql will be used as backend, mentioned in the params.pp file. You'll have to include the postgresql (or mysql) module yourself, as this module will require it.
-
-### Reference zabbix (init.pp)
-This is the class for installing everything on a single host and thus all parameters described earlier and those below can be used with this class.
-
-### Reference zabbix-web
-* `zabbix_url`: This is the url on which Zabbix should be available. Please make sure that the entry exists in the DNS configuration.
-* `zabbix_timezone`: On which timezone the machine is placed. This information is needed for the apache virtual host.
-* `manage_vhost`: Will create an apache virtual host. Default is true.
-* `apache_use_ssl`: Will create an ssl vhost. Also nonssl vhost will be created for redirect nonssl to ssl vhost.
-* `apache_ssl_cert`: The location of the ssl certificate file. You'll need to make sure this file is present on the system, this module will not install this file.
-* `apache_ssl_key`: The location of the ssl key file. You'll need to make sure this file is present on the system, this module will not install this file.
-* `apache_ssl_cipher`: The ssl cipher used. Cipher is used from: https://wiki.mozilla.org/Security/Server_Side_TLS.
-* `apache_ssl_chain`: The ssl_chain file. You'll need to make sure this file is present on the system, this module will not install this file.
-* `apache_php_max_execution_time`: Max execution time for php.
-* `apache_php_memory_limit`: PHP memory size limit.
-* `apache_php_upload_max_filesize`: HP maximum upload filesize.
-* `apache_php_max_input_time`: Max input time for php.
-* `apache_php_always_populate_raw_post_data`: Default: -1
-* `zabbix_api_user`: Username of user in Zabbix which is able to create hosts and edit hosts via the zabbix-api. Default: Admin
-* `zabbix_api_pass`: Password for the user in Zabbix for zabbix-api usage. Default: zabbix
-* `zabbix_template_dir`: The directory where all templates are stored before uploading via API
-* `web_config_owner`: Which user should own the web interface configuration file.
-* `web_config_group`: Which group should own the web interface configuration file.
-* `ldap_cacert`: The location of the CA Cert to be used for Zabbix LDAP authentication. The module will not install this file so it must be present on the system.
-* `ldap_clientcrt`: The location of the Client Cert to be used for Zabbix LDAP authentication. The module will not install this file so it must be present on the system.
-* `ldap_clientkey`: The location of the Client Key to be used for Zabbix LDAP authentication. The module will not install this file so it must be present on the system.
-* `saml_sp_key`: The location of the SAML Service Provider Key file. The module will not install this file so it must be present on the system.
-* `saml_sp_cert`: The location of the SAML Service Provider Certificate. The module will not install this file so it must be present on the system.
-* `saml_idp_cert`: The location of the SAML Identity Provider Certificate. The module will not install this file so it must be present on the system.
-* `saml_settings`: A hash (ruby style) of additional SAML SSO settings as described in the [Zabbix Documentation](https://www.zabbix.com/documentation/current/manual/web_interface/frontend_sections/administration/authentication#advanced_settings)
-
-There are some more zabbix specific parameters, please check them by opening the manifest file.
-
-### Reference zabbix-server
-* `database_path`: When database binaries are not in $PATH, you can use this parameter to append `database_path` to $PATH
-* `tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
-* `tlscertfile`: Full pathname of a file containing the server certificate or certificate chain.
-* `tlscrlfile`: Full pathname of a file containing revoked certificates.
-* `tlskeyfile`: Full pathname of a file containing the server private key.
-
-There are some more zabbix specific parameters, please check them by opening the manifest file.
-
-### Reference zabbix-agent
-* `server`: This is the ipaddress of the zabbix-server or zabbix-proxy.
-* `allowkey`: Allows execution of item keys matching pattern.
-* `denykey`: Deny execution of items keys matching pattern.
-* `tlsaccept`: What incoming connections to accept from Zabbix server. Used for a passive proxy, ignored on an active proxy.
-* `tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
-* `tlscertfile`: Full pathname of a file containing the proxy certificate or certificate chain.
-* `tlsconnect`: How the proxy should connect to Zabbix server. Used for an active proxy, ignored on a passive proxy.
-* `tlscrlfile`: Full pathname of a file containing revoked certificates.
-* `tlskeyfile`: Full pathname of a file containing the proxy private key.
-* `tlspskfile`: Full pathname of a file containing the pre-shared key.
-* `tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key.
-* `tlsservercertissuer`: Allowed server certificate issuer.
-* `tlsservercertsubject`: Allowed server certificate subject.
-
-The following parameters is only needed when `manage_resources` is set to true:
-* `monitored_by_proxy`: When an agent is monitored via an proxy, enter the name of the proxy. The name is found in the webinterface via: Administration -> DM. If it isn't monitored by an proxy or `manage_resources` is false, this parameter can be empty.
-* `agent_use_ip`: Default is set to true. Zabbix server (or proxy) will connect to this host via ip instead of fqdn. When set to false, it will connect via fqdn.
-* `zbx_groups`: An array of hostgroups where this host needs to be added. Default (Array): 'Linux servers'
-* `zbx_group_create`: Default is set to true. Creates the Host Groups in Zabbix when they do not exist yet. When set to false you have to make sure the Host Group exists in Zabbix
-* `zbx_templates`: Name of the templates which will be assigned when agent is installed. Default (Array): 'Template OS Linux', 'Template App SSH Service'
-
-There are some more zabbix specific parameters, please check them by opening the manifest file.
-
-### Reference zabbix-proxy
-* `zabbix_server_host`: The ipaddress or fqdn of the zabbix server.
-* `database_path`: When database binaries are not in $PATH, you can use this parameter to append `database_path` to $PATH
-* `tlsaccept`: What incoming connections to accept from Zabbix server. Used for a passive proxy, ignored on an active proxy.
-* `tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
-* `tlscertfile`: Full pathname of a file containing the proxy certificate or certificate chain.
-* `tlsconnect`: How the proxy should connect to Zabbix server. Used for an active proxy, ignored on a passive proxy.
-* `tlscrlfile`: Full pathname of a file containing revoked certificates.
-* `tlskeyfile`: Full pathname of a file containing the proxy private key.
-* `tlspskfile`: Full pathname of a file containing the pre-shared key.
-* `tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key.
-* `tlsservercertissuer`: Allowed server certificate issuer.
-* `tlsservercertsubject`: Allowed server certificate subject.
-
-The following parameters is only needed when `manage_resources` is set to true:
-* `use_ip`: Default is set to true.
-* `zbx_templates`: List of templates which are needed for the zabbix-proxy. Default: 'Template App Zabbix Proxy'
-* `mode`: Which kind of proxy it is. 0 -> active, 1 -> passive
-
-There are some more zabbix specific parameters, please check them by opening the manifest file.
-
-### Reference zabbix-javagateway
-There are some zabbix specific parameters, please check them by opening the manifest file.
-
-### Reference zabbix-userparameters
-
-* `source`: File which holds several userparameter entries.
-* `content`: When you have 1 userparameter entry which you want to install.
-* `script`: Low level discovery (LLD) script.
-* `script_ext`: The script extention. Should be started with the dot. Like: .sh .bat .py
-* `template`: When you use exported resources (when manage_resources on other components is set to true) you'll can add the name of the template which correspondents with the 'content' or 'source' which you add. The template will be added to the host.
-* `script_dir`: When `script` is used, this parameter can provide the directly where this script needs to be placed. Default: '/usr/bin'
-
-### Reference zabbix-template
-
-* `templ_name`: The name of the template. This name will be found in the Web interface.
-* `templ_source`: The location of the XML file wich needs to be imported.
-* `zabbix_version`: The Zabbix version on which the template will be installed on.
+Take a look at the [REFERENCE.md](https://github.com/voxpupuli/puppet-zabbix/blob/master/REFERENCE.md).
## Limitations
-This module supports Zabbix 4.0, 5.0 and 5.2. The upstream supported versions are documented [here](https://www.zabbix.com/de/life_cycle_and_release_policy)
+This module supports Zabbix 4.0, 5.0, 5.2 and 5.4. The upstream supported versions are documented [here](https://www.zabbix.com/de/life_cycle_and_release_policy)
Please have a look into the metadata.json for all supported operating systems.
This module is supported on both the community and the Enterprise version of Puppet.

original_message:
Drop Reference from README

Signed-off-by: Christos Papageorgiou <root.expert.xda@gmail.com>


message: Modulesync 4.2.0

diff:
@@ -25,7 +25,7 @@ By participating in this project you agree to abide by its terms.
* Fork the repo.
* Create a separate branch for your change.
-* We only take pull requests with passing tests, and documentation. GitHub Actions run the tests for us (check the .github/workflows/ directory). You can also execute them locally. This is explained [in a later section](#the-test-matrix).
+* We only take pull requests with passing tests, and documentation. [GitHub Actions](https://docs.github.com/en/actions) run the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix).
* Checkout [our docs](https://voxpupuli.org/docs/reviewing_pr/) we use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html). They provide some guidance for new code that might help you before you submit a pull request.
* Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test.
* Squash your commits down into logical components. Make sure to rebase against our current master.

diff:
@@ -12,9 +12,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 40
outputs:
- beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }}
- puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
+ github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
steps:
@@ -64,8 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
- puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
+ include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- uses: actions/checkout@v2
@@ -79,3 +77,12 @@ jobs:
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
+
+ tests:
+ needs:
+ - unit
+ - acceptance
+ runs-on: ubuntu-latest
+ name: Test suite
+ steps:
+ - run: echo Test suite completed

diff:
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
-modulesync_config_version: '4.1.0'
+modulesync_config_version: '4.2.0'

old_path: Gemfile

new_path: Gemfile

diff:
source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :test do
- gem 'voxpupuli-test', '~> 2.1', :require => false
+ gem 'voxpupuli-test', '~> 2.5', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
- gem 'puppet_metadata', '~> 0.3.0', :require => false
+ gem 'puppet_metadata', '~> 1.0', :require => false
gem 'fakefs', :require => false
gem 'zabbixapi', :require => false
gem 'puppet-lint-param-docs', :require => false
@@ -23,7 +23,7 @@ group :system_tests do
end
group :release do
- gem 'github_changelog_generator', '>= 1.16.1', :require => false
+ gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5'
gem 'voxpupuli-release', '>= 1.0.2', :require => false
gem 'puppet-strings', '>= 2.2', :require => false
end

original_message: Modulesync 4.2.0


message: Add Debian 11 support

diff:
@@ -214,6 +214,12 @@ class zabbix::agent (
String $service_type = $zabbix::params::service_type,
Boolean $manage_startup_script = $zabbix::params::manage_startup_script,
) inherits zabbix::params {
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Find if listenip is set. If not, we can set to specific ip or
# to network name. If more than 1 interfaces are available, we
# can find the ipaddress of this specific interface if listenip

diff:
@@ -301,6 +301,12 @@ class zabbix::proxy (
fail('Archlinux is currently not supported for zabbix::proxy ')
}
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Find if listenip is set. If not, we can set to specific ip or
# to network name. If more than 1 interfaces are available, we
# can find the ipaddress of this specific interface if listenip

diff:
@@ -277,6 +277,12 @@ class zabbix::server (
}
}
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Only include the repo class if it has not yet been included
unless defined(Class['Zabbix::Repo']) {
class { 'zabbix::repo':

diff:
@@ -156,6 +156,12 @@ class zabbix::web (
}
}
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Only include the repo class if it has not yet been included
unless defined(Class['Zabbix::Repo']) {
class { 'zabbix::repo':

diff:
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9",
- "10"
+ "10",
+ "11"
]
},
{

diff:
require 'spec_helper_acceptance'
supported_versions.each do |version|
+ # No Zabbix 5.2 packages on Debian 11
+ next if version == '5.2' && default[:platform] == 'debian-11-amd64'
+
describe "zabbix::agent class with zabbix_version #{version}" do
it 'works idempotently with no errors' do
pp = <<-EOS

diff:
@@ -7,6 +7,8 @@ describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
# Application API was removed in Zabbix 5.4
next if zabbix_version == '5.4'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
template = case zabbix_version
when '4.0'

diff:
@@ -7,6 +7,8 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_host resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

diff:
@@ -6,6 +6,8 @@ describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(ubuntu-16.04
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_hostgroup resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

diff:
@@ -7,6 +7,8 @@ describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(ubuntu-16.04|deb
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_proxy resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

diff:
@@ -6,6 +6,8 @@ describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-1
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_template_host resources with zabbix version #{zabbix_version}" do
template = case zabbix_version
when '4.0'

diff:
@@ -6,6 +6,8 @@ describe 'zabbix_template type', unless: default[:platform] =~ %r{(ubuntu-16.04|
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_template resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

diff:
@@ -398,8 +398,8 @@ describe 'zabbix::server' do
end
end
- # Zabbix Server 5.2 is not supported on RedHat family
- if facts[:osfamily] != 'RedHat'
+ # Zabbix Server 5.2 is not supported on RedHat family and Debian 11
+ if facts[:osfamily] != 'RedHat' && facts[:os]['release']['major'] != '11'
describe 'with zabbix_version 5.2 and Vault parameters defined' do
let :params do
{

diff:
@@ -19,6 +19,8 @@ describe 'zabbix::web' do
next if facts[:os]['name'] == 'Gentoo'
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'] == '9'
next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '16.04'
+ # There are no zabbix 5.2 packages for Debian 11
+ next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'] == '11' && zabbix_version == '5.2'
context "on #{os} " do
let :facts do

original_message:
Add Debian 11 support

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>


message: Pin apt source to higher priority.

diff:
@@ -134,10 +134,17 @@ class zabbix::repo (
id => 'A1848F5352D022B9471D83D0082AB56BA14FE591',
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
}
+
+ # Debian 11 provides Zabbix 5.0 by default. This can cause problems for 4.0 versions
+ $pinpriority = $facts['os']['release']['major'] ? {
+ '11' => 1000,
+ default => undef,
+ }
apt::source { 'zabbix':
location => $_repo_location,
repos => 'main',
release => $releasename,
+ pin => $pinpriority,
require => [
Apt_key['zabbix-FBABD5F'],
Apt_key['zabbix-A1848F5'],

original_message:
Pin apt source to higher priority.

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>


diff:
@@ -312,11 +312,16 @@ class zabbix::agent (
}
}
+ $service_require = $manage_startup_script ? {
+ true => [Package[$zabbix_package_agent], Zabbix::Startup[$servicename]],
+ false => Package[$zabbix_package_agent]
+ }
+
# Controlling the 'zabbix-agent' service
service { $servicename:
ensure => $service_ensure,
enable => $service_enable,
- require => Package[$zabbix_package_agent],
+ require => $service_require,
}
# Override the service provider on AIX

diff:
@@ -82,7 +82,7 @@ describe 'zabbix::agent' do
with_ensure('running').
with_enable(true).
with_service_provider(facts[:osfamily] == 'AIX' ? 'init' : nil).
- that_requires("Package[#{package_name}]")
+ that_requires(["Package[#{package_name}]", "Zabbix::Startup[#{service_name}]"])
end
it { is_expected.to contain_file(include_dir).with_ensure('directory') }

original_message:
agent: Require startup script for the service

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>


message: Fix typo in repo.pp

diff:
@@ -118,7 +118,7 @@ class zabbix::repo (
,
}
} else {
- if ($facts['os']['distro'][id] == 'Raspbian') {
+ if ($facts['os']['distro']['id'] == 'Raspbian') {
$operatingsystem = 'raspbian'
} else {
$operatingsystem = downcase($facts['os']['name'])

original_message:
Fix typo in repo.pp

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>


message: agent: Default denykey to undef

diff:
@@ -297,7 +297,7 @@ class zabbix::params {
$agent_buffersize = '100'
$agent_debuglevel = '3'
$agent_allowkey = undef
- $agent_denykey = 'system.run[*]'
+ $agent_denykey = undef
$agent_enableremotecommands = '0'
$agent_hostmetadata = undef
$agent_hostmetadataitem = undef

original_message:
agent: Default denykey to undef

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>


message: Drop EoL Ubuntu 16.04

diff:
@@ -151,7 +151,7 @@ class zabbix::web (
# zabbix frontend 5.x is not supported, among others, on stretch and xenial.
# https://www.zabbix.com/documentation/current/manual/installation/frontend/frontend_on_debian
if $facts['os']['name'] in ['ubuntu', 'debian'] and versioncmp($zabbix_version, '5') >= 0 {
- if versioncmp($facts['os']['release']['major'], '16.04') == 0 or versioncmp($facts['os']['release']['major'], '9') == 0 {
+ if versioncmp($facts['os']['release']['major'], '9') == 0 {
fail("${facts['os']['family']} ${$facts['os']['release']['major']} is not supported for zabbix::web")
}
}
@@ -227,29 +227,7 @@ class zabbix::web (
case $facts['os']['name'] {
'ubuntu', 'debian': {
$zabbix_web_package = 'zabbix-frontend-php'
-
- # Check OS release for proper prefix
- case $facts['os']['name'] {
- 'Ubuntu': {
- if versioncmp($facts['os']['release']['major'], '16.04') >= 0 {
- $php_db_package = "php-${db}"
- }
- else {
- $php_db_package = "php5-${db}"
- }
- }
- 'Debian': {
- if versioncmp($facts['os']['release']['major'], '9') >= 0 {
$php_db_package = "php-${db}"
- }
- else {
- $php_db_package = "php5-${db}"
- }
- }
- default: {
- $php_db_package = "php5-${db}"
- }
- }
package { $php_db_package:
ensure => $zabbix_package_state,

diff:
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
- "16.04",
"18.04",
"20.04"
]

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
-describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
+describe 'zabbix_application type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'

diff:
@@ -4,7 +4,7 @@ require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
# rubocop:disable RSpec/LetBeforeExamples
-describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
+describe 'zabbix_host type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
-describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
+describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

diff:
@@ -4,7 +4,7 @@ require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
# rubocop:disable RSpec/LetBeforeExamples
-describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
+describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
-describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
+describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# Zabbix 6.0 removed the ability to attach templates directly to hosts.
next if zabbix_version == '6.0'

diff:
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'
-describe 'zabbix_template type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
+describe 'zabbix_template type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

diff:
@@ -52,28 +52,6 @@ describe 'zabbix::repo' do
it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/5.0/debian/') }
end
- when '16.04'
- context 'on Ubuntu 14.04 and Zabbix 5.0' do
- let :params do
- {
- zabbix_version: '5.0',
- manage_repo: true
- }
- end
-
- it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/5.0/ubuntu/') }
- end
-
- context 'on Ubuntu 16.04 and Zabbix 4.0' do
- let :params do
- {
- zabbix_version: '4.0',
- manage_repo: true
- }
- end
-
- it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/4.0/ubuntu/') }
- end
end
when 'RedHat'

diff:
@@ -20,7 +20,6 @@ describe 'zabbix::web' do
next if facts[:os]['name'] == 'Archlinux'
next if facts[:os]['name'] == 'Gentoo'
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'] == '9'
- next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '16.04'
# There are no zabbix 5.2 packages for Debian 11
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'] == '11' && zabbix_version == '5.2'
@@ -64,22 +63,7 @@ describe 'zabbix::web' do
super().merge(zabbix_version: zabbix_version)
end
- pgsqlpackage = case facts[:operatingsystem]
- when 'Ubuntu'
- if facts[:operatingsystemmajrelease] >= '16.04'
- 'php-pgsql'
- else
- 'php5-pgsql'
- end
- when 'Debian'
- if facts[:operatingsystemmajrelease].to_i >= 9
- 'php-pgsql'
- else
- 'php5-pgsql'
- end
- else
- 'php5-pgsql'
- end
+ pgsqlpackage = 'php-pgsql'
packages = if facts[:osfamily] == 'RedHat'
if facts[:operatingsystemmajrelease].to_i == 7 &&
@@ -104,22 +88,7 @@ describe 'zabbix::web' do
super().merge(database_type: 'mysql')
end
- mysqlpackage = case facts[:operatingsystem]
- when 'Ubuntu'
- if facts[:operatingsystemmajrelease] >= '16.04'
- 'php-mysql'
- else
- 'php5-mysql'
- end
- when 'Debian'
- if facts[:operatingsystemmajrelease].to_i >= 9
- 'php-mysql'
- else
- 'php5-mysql'
- end
- else
- 'php5-mysql'
- end
+ mysqlpackage = 'php-mysql'
packages = facts[:osfamily] == 'RedHat' ? %w[zabbix-web-mysql zabbix-web] : ['zabbix-frontend-php', mysqlpackage]
packages.each do |package|

diff:
@@ -13,7 +13,7 @@ def baseline_os_hash
},
{
'operatingsystem' => 'Ubuntu',
- 'operatingsystemrelease' => %w[16.04 18.04 20.04]
+ 'operatingsystemrelease' => %w[18.04 20.04]
},
{
'operatingsystem' => 'Archlinux',

original_message: Drop EoL Ubuntu 16.04


message: chore(kork): fix compatibility with latest kork

diff:
@@ -18,7 +18,7 @@ allprojects {
apply plugin: 'groovy'
ext {
- spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.87.0'
+ spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.89.0'
}
def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion]

diff:
package com.netflix.spinnaker.gate.services.commands
+import java.util.concurrent.Callable
import com.netflix.hystrix.HystrixCommand
import com.netflix.hystrix.HystrixCommandKey
import com.netflix.spinnaker.gate.retrofit.UpstreamBadRequest
@@ -23,10 +24,8 @@ import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.springframework.http.HttpStatus
import retrofit.RetrofitError
-
import static HystrixFactory.createHystrixCommandPropertiesSetter
import static HystrixFactory.toGroupKey
-import static retrofit.RetrofitError.Kind.HTTP
@Slf4j
@CompileStatic
@@ -35,13 +34,13 @@ abstract class AbstractHystrixCommand<T> extends HystrixCommand<T> {
private final String groupKey
private final String commandKey
- protected final Closure work
- protected final Closure fallback
+ protected final Callable<T> work
+ protected final Callable<T> fallback
public AbstractHystrixCommand(String groupKey,
String commandKey,
- Closure work,
- Closure fallback) {
+ Callable<T> work,
+ Callable<T> fallback) {
super(HystrixCommand.Setter.withGroupKey(toGroupKey(groupKey))
.andCommandKey(HystrixCommandKey.Factory.asKey(commandKey))
.andCommandPropertiesDefaults(createHystrixCommandPropertiesSetter()))
@@ -54,14 +53,14 @@ abstract class AbstractHystrixCommand<T> extends HystrixCommand<T> {
@Override
protected T run() throws Exception {
try {
- return work()
+ return work.call()
} catch (RetrofitError error) {
throw UpstreamBadRequest.classifyError(error, HttpStatus.values().findAll { it.is4xxClientError() }*.value() as Collection<Integer>)
}
}
protected T getFallback() {
- return (fallback.call() as T)
+ return fallback.call()
}
@Override

diff:
package com.netflix.spinnaker.gate.services.commands
+import java.util.concurrent.Callable
import com.netflix.hystrix.HystrixCommandGroupKey
import com.netflix.hystrix.HystrixCommandProperties
import static com.netflix.spinnaker.security.AuthenticatedRequest.propagate
@@ -29,56 +30,56 @@ class HystrixFactory {
HystrixCommandGroupKey.Factory.asKey(name)
}
- public static ListCommand newListCommand(String groupKey,
+ public static <T> ListCommand newListCommand(String groupKey,
String commandKey,
- Closure<? extends List> work,
- Closure<? extends List> fallback = { null }) {
+ Callable<List<T>> work,
+ Callable<List<T>> fallback = { null }) {
new ListCommand(groupKey, commandKey, propagate(work, false), fallback)
}
- public static MapCommand newMapCommand(String groupKey,
+ public static <K, V> MapCommand<K, V> newMapCommand(String groupKey,
String commandKey,
- Closure<? extends Map> work,
- Closure<? extends Map> fallback = { null }) {
+ Callable<Map<K, V>> work,
+ Callable<Map<K, V>> fallback = { null }) {
new MapCommand(groupKey, commandKey, propagate(work, false), fallback)
}
public static StringCommand newStringCommand(String groupKey,
String commandKey,
- Closure<? extends String> work,
- Closure<? extends String> fallback = { null }) {
+ Callable<String> work,
+ Callable<String> fallback = { null }) {
new StringCommand(groupKey, commandKey, propagate(work, false), fallback )
}
public static VoidCommand newVoidCommand(String groupKey,
String commandKey,
- Closure<?> work,
- Closure<?> fallback = { null }) {
+ Callable<Void> work,
+ Callable<Void> fallback = { null }) {
new VoidCommand(groupKey, commandKey, propagate(work, false), fallback )
}
- static class ListCommand extends AbstractHystrixCommand<List> {
- ListCommand(String groupKey, String commandKey, Closure work, Closure fallback) {
+ static class ListCommand<T> extends AbstractHystrixCommand<List<T>> {
+ ListCommand(String groupKey, String commandKey, Callable<List<T>> work, Callable<List<T>> fallback) {
super(groupKey, commandKey, work, fallback)
}
}
- static class MapCommand extends AbstractHystrixCommand<Map> {
- MapCommand(String groupKey, String commandKey, Closure work, Closure fallback) {
+ static class MapCommand<K, V> extends AbstractHystrixCommand<Map<K, V>> {
+ MapCommand(String groupKey, String commandKey, Callable<Map<K, V>> work, Callable<Map<K, V>> fallback) {
super(groupKey, commandKey, work, fallback)
}
}
static class StringCommand extends AbstractHystrixCommand<String> {
- StringCommand(String groupKey, String commandKey, Closure work, Closure fallback) {
+ StringCommand(String groupKey, String commandKey, Callable<String> work, Callable<String> fallback) {
super(groupKey, commandKey, work, fallback)
}
}
static class VoidCommand extends AbstractHystrixCommand<Void> {
- VoidCommand(String groupKey, String commandKey, Closure work, Closure fallback) {
+ VoidCommand(String groupKey, String commandKey, Callable<Void> work, Callable<Void> fallback) {
super(groupKey, commandKey, work, fallback)
}
}

diff:
package com.netflix.spinnaker.gate.services
+import java.util.concurrent.Callable
import com.netflix.hystrix.HystrixCommand
import com.netflix.spinnaker.gate.services.commands.HystrixFactory
import com.netflix.spinnaker.gate.services.internal.ClouddriverService
@@ -32,12 +33,12 @@ class NetworkService {
@Autowired
ClouddriverService clouddriverService
- private static <T extends List> HystrixCommand<T> listCommand(String type, Closure<T> work) {
- (HystrixCommand<T>)HystrixFactory.newListCommand(GROUP, type, work)
+ private static HystrixCommand<List> listCommand(String type, Callable<List> work) {
+ HystrixFactory.newListCommand(GROUP, type, work)
}
- private static <T extends Map> HystrixCommand<T> mapCommand(String type, Closure<T> work) {
- (HystrixCommand<T>)HystrixFactory.newMapCommand(GROUP, type, work)
+ private static HystrixCommand<Map> mapCommand(String type, Callable<Map> work) {
+ HystrixFactory.newMapCommand(GROUP, type, work)
}
Map getNetworks() {

diff:
package com.netflix.spinnaker.gate.services.aws
+import java.util.concurrent.Callable
import com.netflix.hystrix.HystrixCommand
import com.netflix.spinnaker.gate.services.commands.HystrixFactory
import com.netflix.spinnaker.gate.services.internal.ClouddriverService
@@ -32,8 +33,8 @@ class InfrastructureService {
@Autowired
ClouddriverService clouddriverService
- private static <T extends List> HystrixCommand<T> command(String type, Closure<T> work) {
- (HystrixCommand<T>)HystrixFactory.newListCommand(GROUP, type, work)
+ private static HystrixCommand<List> command(String type, Callable<List> work) {
+ (HystrixCommand<List>)HystrixFactory.newListCommand(GROUP, type, work)
}
List<Map> getInstanceTypes() {

repo: spinnaker/gate


message: feature(orca): expose execution log endpoint

diff:
@@ -28,13 +28,7 @@ import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
-import org.springframework.web.bind.annotation.PathVariable
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RequestMethod
-import org.springframework.web.bind.annotation.RequestParam
-import org.springframework.web.bind.annotation.ResponseStatus
-import org.springframework.web.bind.annotation.RestController
+import org.springframework.web.bind.annotation.*
import retrofit.RetrofitError
@Slf4j
@@ -76,6 +70,17 @@ class PipelineController {
pipelineService.update(id, pipeline)
}
+ @RequestMapping(value = "{id}/logs", method = RequestMethod.GET)
+ List<Map> getPipelineLogs(@PathVariable("id") String id) {
+ try {
+ pipelineService.getPipelineLogs(id)
+ } catch (RetrofitError e) {
+ if (e.response?.status == 404) {
+ throw new PipelineNotFoundException()
+ }
+ }
+ }
+
@RequestMapping(value = "{id}/cancel", method = RequestMethod.PUT)
Map cancelPipeline(@PathVariable("id") String id,
@RequestParam(required = false) String reason,

diff:
@@ -91,6 +91,10 @@ class PipelineService {
orcaService.getPipeline(id)
}
+ List<Map> getPipelineLogs(String id) {
+ orcaService.getPipelineLogs(id)
+ }
+
Map cancelPipeline(String id, String reason, boolean force) {
orcaService.cancelPipeline(id, reason, force, "")
}

diff:
@@ -68,6 +68,10 @@ interface OrcaService {
@GET("/pipelines/{id}")
Map getPipeline(@Path("id") String id)
+ @Headers("Accept: application/json")
+ @GET("/pipelines/{id}/logs")
+ List<Map> getPipelineLogs(@Path("id") String id)
+
@Headers("Accept: application/json")
@PUT("/pipelines/{id}/cancel")
Map cancelPipeline(@Path("id") String id, @Query("reason") reason, @Query("force") force, @Body String ignored)


message: chore(orca): removed active executions / instance endpoint no longer in orca

diff:
*/
package com.netflix.spinnaker.gate.controllers;
-import com.netflix.spinnaker.gate.services.TaskService;
+import java.util.List;
import com.netflix.spinnaker.gate.services.internal.OrcaService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,28 +24,17 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
-import java.util.Map;
-
@RequestMapping("/executions")
@RestController
public class ExecutionsController {
- private TaskService taskService;
private OrcaService orcaService;
@Autowired
- public ExecutionsController(TaskService taskService, OrcaService orcaService) {
- this.taskService = taskService;
+ public ExecutionsController(OrcaService orcaService) {
this.orcaService = orcaService;
}
- @ApiOperation(value = "Retrieve a list of active executions, grouped by Orca instance")
- @RequestMapping(value = "/activeByInstance", method = RequestMethod.GET)
- Map getActiveExecutionsByInstance() {
- return taskService.getActiveExecutionsByInstance();
- }
-
@ApiOperation(value = "Retrieve a list of the most recent pipeline executions for the provided `pipelineConfigIds` that match the provided `statuses` query parameter")
@RequestMapping(method = RequestMethod.GET)
List getLatestExecutionsByConfigIds(@RequestParam(value = "pipelineConfigIds") String pipelineConfigIds,

diff:
@@ -77,12 +77,6 @@ class TaskService {
} execute()
}
- Map getActiveExecutionsByInstance() {
- HystrixFactory.newMapCommand(GROUP, "getActiveExecutionsByInstance") {
- orcaService.getActiveExecutionsByInstance()
- } execute()
- }
-
/**
* @deprecated This pipeline operation does not belong here.
*/

diff:
@@ -56,10 +56,6 @@ interface OrcaService {
@PUT("/tasks/cancel")
Map cancelTasks(@Body List<String> taskIds)
- @Headers("Accept: application/json")
- @GET("/executions/activeByInstance")
- Map getActiveExecutionsByInstance()
-
@Headers("Accept: application/json")
@GET("/pipelines")
List getLatestExecutionsByConfigIds(@Query("pipelineConfigIds") String pipelineConfigIds, @Query("limit") Integer limit, @Query("statuses") String statuses)


message: feat(pagination): support the 'page' qs param in orca's tasks endpoint

diff:
@@ -104,9 +104,10 @@ class ApplicationController {
@ApiOperation(value = "Retrieve a list of an application's tasks", response = List.class)
@RequestMapping(value = "/{application}/tasks", method = RequestMethod.GET)
List getTasks(@PathVariable("application") String application,
+ @RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "statuses", required = false) String statuses) {
- executionHistoryService.getTasks(application, limit, statuses)
+ executionHistoryService.getTasks(application, page, limit, statuses)
}
@ApiOperation(value = "Retrieve a list of an application's pipeline executions", response = List.class)

diff:
@@ -33,12 +33,12 @@ class ExecutionHistoryService {
@Autowired
OrcaServiceSelector orcaServiceSelector
- List getTasks(String app, Integer limit, String statuses) {
+ List getTasks(String app, Integer page, Integer limit, String statuses) {
Preconditions.checkNotNull(app)
RequestContext requestContext = RequestContext.get()
def command = HystrixFactory.newListCommand("taskExecutionHistory", "getTasksForApp") {
- orcaServiceSelector.withContext(requestContext).getTasks(app, limit, statuses)
+ orcaServiceSelector.withContext(requestContext).getTasks(app, page, limit, statuses)
}
return command.execute()
}

diff:
@@ -35,7 +35,7 @@ interface OrcaService {
@Headers("Accept: application/json")
@GET("/applications/{application}/tasks")
- List getTasks(@Path("application") String app, @Query("limit") Integer limit, @Query("statuses") String statuses)
+ List getTasks(@Path("application") String app, @Query("page") Integer page, @Query("limit") Integer limit, @Query("statuses") String statuses)
@Headers("Accept: application/json")
@GET("/v2/applications/{application}/pipelines")

diff:
@@ -27,7 +27,7 @@ interface Api {
Map getApplication(@Path("name") String name)
@GET("/applications/{name}/tasks")
- List getTasks(@Path("name") String name, @Query("limit") Integer limit, @Query("statuses") String statuses)
+ List getTasks(@Path("name") String name, @Query("page") Integer page, @Query("limit") Integer limit, @Query("statuses") String statuses)
@POST("/applications/{name}/tasks")
Map createTask(@Path("name") String name, @Body Map body)

diff:
@@ -191,11 +191,11 @@ class FunctionalSpec extends Specification {
void "should call ApplicationService for an application's tasks"() {
when:
- api.getTasks(name, null, "RUNNING,TERMINAL")
+ api.getTasks(name, null, null, "RUNNING,TERMINAL")
then:
1 * orcaServiceSelector.withContext(_) >> { orcaService }
- 1 * orcaService.getTasks(name, null, "RUNNING,TERMINAL") >> []
+ 1 * orcaService.getTasks(name, null, null, "RUNNING,TERMINAL") >> []
where:
name = "foo"
@@ -215,19 +215,19 @@ class FunctionalSpec extends Specification {
void "should throw ServerErrorException(500) on a random thrown exception"() {
when:
- def tasks = executionHistoryService.getTasks("app", 5, null)
+ def tasks = executionHistoryService.getTasks("app", null, 5, null)
then:
1 * orcaServiceSelector.withContext(_) >> { orcaService }
- 1 * orcaService.getTasks("app", 5, null) >> { return ["1"] }
+ 1 * orcaService.getTasks("app", null, 5, null) >> { return ["1"] }
tasks == ["1"]
when:
- executionHistoryService.getTasks("app", 10, "RUNNING")
+ executionHistoryService.getTasks("app", null, 10, "RUNNING")
then:
1 * orcaServiceSelector.withContext(_) >> { orcaService }
- 1 * orcaService.getTasks("app", 10, "RUNNING") >> { throw new IllegalStateException() }
+ 1 * orcaService.getTasks("app", null, 10, "RUNNING") >> { throw new IllegalStateException() }
thrown(ServerErrorException)
when:


message:
fix(gate): fix startup with redis.configuration.secure
Apparently if an parameter has no it will accept
both unqualified AND qualified beans. I assumed it worked like Guice,
which only matches unqualified beans with unqualified parameters.
Whoops.

diff:
@@ -62,6 +62,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.web.servlet.FilterRegistrationBean
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
+import org.springframework.context.annotation.Primary
import org.springframework.core.Ordered
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer
import org.springframework.session.data.redis.config.ConfigureRedisAction
@@ -125,6 +126,7 @@ class GateConfig extends RedisHttpSessionConfiguration {
* {@link PostConnectionConfiguringJedisConnectionFactory}.
* */
@Bean
+ @Primary
ConfigureRedisAction springBootConfigureRedisAction() {
return ConfigureRedisAction.NO_OP
}

original_message:
fix(gate): fix startup with redis.configuration.secure (#776)

Apparently if an @AutoWired parameter has no @Qualifier, it will accept
both unqualified AND qualified beans. I assumed it worked like Guice,
which only matches unqualified beans with unqualified parameters.
Whoops.


message:
fix(ldap): Disable the broken LdapHealthIndicatorAutoConfiguration
We can reenable it once we upgrade to a version of spring-boot with the
fix for spring-projects/spring-ldap#473

diff:
package com.netflix.spinnaker.gate
import com.netflix.spinnaker.hystrix.spectator.HystrixSpectatorConfig
+import org.springframework.boot.actuate.autoconfigure.ldap.LdapHealthIndicatorAutoConfiguration
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
@@ -32,7 +33,7 @@ import org.springframework.scheduling.annotation.EnableAsync
@EnableConfigurationProperties
@Import([HystrixSpectatorConfig])
@ComponentScan(["com.netflix.spinnaker.gate", "com.netflix.spinnaker.config"])
-@EnableAutoConfiguration(exclude = [GroovyTemplateAutoConfiguration, GsonAutoConfiguration])
+@EnableAutoConfiguration(exclude = [GroovyTemplateAutoConfiguration, GsonAutoConfiguration, LdapHealthIndicatorAutoConfiguration])
class Main {
static final Map<String, String> DEFAULT_PROPS = [

diff:
@@ -41,6 +41,7 @@ import com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService
import com.netflix.spinnaker.kork.dynamicconfig.SpringDynamicConfigService
import com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlers
import org.springframework.boot.SpringApplication
+import org.springframework.boot.actuate.autoconfigure.ldap.LdapHealthIndicatorAutoConfiguration
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
@@ -253,7 +254,7 @@ class FunctionalSpec extends Specification {
}
@Order(10)
- @EnableAutoConfiguration(exclude = [GroovyTemplateAutoConfiguration, GsonAutoConfiguration])
+ @EnableAutoConfiguration(exclude = [GroovyTemplateAutoConfiguration, GsonAutoConfiguration, LdapHealthIndicatorAutoConfiguration])
private static class FunctionalConfiguration extends WebSecurityConfigurerAdapter {
@Bean

original_message:
fix(ldap): Disable the broken LdapHealthIndicatorAutoConfiguration (#796)

We can reenable it once we upgrade to a version of spring-boot with the
fix for spring-projects/spring-ldap#473


diff:
+# Spinnaker IntelliJ IDEA files
+
+IntelliJ IDEA will modify some of these files from their checked-in versions when the project is
+opened. To work around this, the Spinnaker Gradle plugin will mark these files in Git as "assume
+unchanged", telling Git to ignore any local changes. If you want to commit changes to these files,
+you will need to undo that.
+
+```bash
+$ git update-index --no-assume-unchanged $FILENAME
+```

diff:
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="CompilerConfiguration">
+ <annotationProcessing>
+ <profile default="true" name="Default" enabled="true" />
+ </annotationProcessing>
+ </component>
+</project>
\ No newline at end of file

diff:
+<component name="CopyrightManager">
+ <copyright>
+ <option name="notice" value="Copyright &#36;today.year Netflix, Inc.

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.
" />
+ <option name="myName" value="ALS2" />
+ </copyright>
+</component>
\ No newline at end of file

diff:
+<component name="CopyrightManager">
+ <settings default="ALS2" />
+</component>
\ No newline at end of file

diff:
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="GoogleJavaFormatSettings">
+ <option name="state" value="ENABLED" />
+ </component>
+</project>
\ No newline at end of file

diff:
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="GradleSettings">
+ <option name="linkedExternalProjectsSettings">
+ <GradleProjectSettings>
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
+ <option name="useAutoImport" value="true" />
+ </GradleProjectSettings>
+ </option>
+ </component>
+</project>
\ No newline at end of file

diff:
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="Git" />
+ </component>
+</project>
\ No newline at end of file

diff:
#Tue Jul 16 18:16:28 UTC 2019
fiatVersion=1.1.0
enablePublishing=false
-spinnakerGradleVersion=6.5.0
+spinnakerGradleVersion=7.0.1
korkVersion=5.8.7
includeProviders=basic,iap,ldap,oauth2,saml,x509
org.gradle.parallel=true

original_message: chore(intellij): Add IDEA project files. (#862)


message: feat(keel): reflect change in how resource history works in Keel API

diff:
@@ -19,7 +19,6 @@ package com.netflix.spinnaker.gate.services.internal;
import com.netflix.spinnaker.kork.manageddelivery.model.Resource;
import com.netflix.spinnaker.kork.manageddelivery.model.ResourceEvent;
-import java.time.Instant;
import java.util.List;
import java.util.Map;
import retrofit.http.Body;
@@ -32,7 +31,7 @@ import retrofit.http.Query;
public interface KeelService {
@GET("/resources/events/{name}")
- List<ResourceEvent> getResourceEvents(@Path("name") String name, @Query("since") Instant since);
+ List<ResourceEvent> getResourceEvents(@Path("name") String name, @Query("limit") Integer limit);
@GET("/resources/{name}")
Resource getResource(@Path("name") String name);

diff:
@@ -4,7 +4,6 @@ import com.netflix.spinnaker.gate.services.internal.KeelService;
import com.netflix.spinnaker.kork.manageddelivery.model.ResourceEvent;
import groovy.util.logging.Slf4j;
import io.swagger.annotations.ApiOperation;
-import java.time.Instant;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,7 +33,7 @@ public class HistoryController {
@RequestMapping(value = "/{name}", method = RequestMethod.GET)
List<ResourceEvent> getHistory(
@PathVariable("name") String name,
- @RequestParam(value = "since", required = false) Instant since) {
- return keelService.getResourceEvents(name, since);
+ @RequestParam(value = "limit", required = false) Integer limit) {
+ return keelService.getResourceEvents(name, limit);
}
}


message: feat(keel): endpoints for delivery config manifests

diff:
*/
package com.netflix.spinnaker.gate.services.internal;
+import com.netflix.spinnaker.kork.manageddelivery.model.DeliveryConfig;
import com.netflix.spinnaker.kork.manageddelivery.model.Resource;
import com.netflix.spinnaker.kork.manageddelivery.model.ResourceEvent;
import java.util.List;
@@ -42,6 +43,12 @@ public interface KeelService {
@DELETE("/resources/{name}")
Resource deleteResource(@Path("name") String name);
+ @GET("/delivery-configs/{name}")
+ DeliveryConfig getManifest(@Path("name") String name);
+
+ @POST("/delivery-configs")
+ DeliveryConfig upsertManifest(@Body DeliveryConfig manifest);
+
@GET("/application/{application}")
Map getApplicationDetails(
@Path("application") String application, @Query("includeDetails") Boolean includeDetails);

diff:
package com.netflix.spinnaker.gate.controllers;
+import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
+import static org.springframework.web.bind.annotation.RequestMethod.GET;
+import static org.springframework.web.bind.annotation.RequestMethod.POST;
+
import com.netflix.spinnaker.gate.services.internal.KeelService;
+import com.netflix.spinnaker.kork.manageddelivery.model.DeliveryConfig;
import com.netflix.spinnaker.kork.manageddelivery.model.Resource;
import groovy.util.logging.Slf4j;
import io.swagger.annotations.ApiOperation;
@@ -12,7 +17,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -31,25 +35,39 @@ public class ManagedController {
}
@ApiOperation(value = "Get a resource", response = Resource.class)
- @RequestMapping(value = "/resources/{name}", method = RequestMethod.GET)
+ @RequestMapping(value = "/resources/{name}", method = GET)
Resource getResource(@PathVariable("name") String name) {
return keelService.getResource(name);
}
@ApiOperation(value = "Create or update a resource", response = Resource.class)
- @RequestMapping(value = "/resources", method = RequestMethod.POST)
+ @RequestMapping(value = "/resources", method = POST)
Resource upsertResource(@RequestBody Resource resource) {
return keelService.upsertResource(resource);
}
@ApiOperation(value = "Delete a resource", response = Resource.class)
- @RequestMapping(value = "/resources/{name}", method = RequestMethod.DELETE)
+ @RequestMapping(value = "/resources/{name}", method = DELETE)
Resource deleteResource(@PathVariable("name") String name) {
return keelService.deleteResource(name);
}
+ @ApiOperation(value = "Get a delivery config manifest", response = DeliveryConfig.class)
+ @RequestMapping(value = "/delivery-configs/{name}", method = GET)
+ DeliveryConfig getManifest(@PathVariable("name") String name) {
+ return keelService.getManifest(name);
+ }
+
+ @ApiOperation(
+ value = "Create or update a delivery config manifest",
+ response = DeliveryConfig.class)
+ @RequestMapping(value = "/delivery-configs", method = POST)
+ DeliveryConfig upsertManifest(@RequestBody DeliveryConfig manifest) {
+ return keelService.upsertManifest(manifest);
+ }
+
@ApiOperation(value = "Get managed details about an application", response = Map.class)
- @RequestMapping(value = "/application/{application}", method = RequestMethod.GET)
+ @RequestMapping(value = "/application/{application}", method = GET)
Map getApplicationDetails(
@PathVariable("application") String application,
@RequestParam(value = "includeDetails", required = false, defaultValue = "false")


message: feat(managed): endpoint for getting artifact versions per environment

diff:
@@ -53,6 +53,9 @@ public interface KeelService {
@GET("/delivery-configs/{name}")
DeliveryConfig getManifest(@Path("name") String name);
+ @GET("/delivery-configs/{name}/artifacts")
+ List<Map<String, Object>> getManifestArtifacts(@Path("name") String name);
+
@POST("/delivery-configs")
DeliveryConfig upsertManifest(@Body DeliveryConfig manifest);

diff:
@@ -110,6 +110,14 @@ public class ManagedController {
return keelService.getManifest(name);
}
+ @ApiOperation(
+ value = "Get the status of each version of each artifact in each environment",
+ response = List.class)
+ @GetMapping(path = "/delivery-configs/{name}/artifacts")
+ List<Map<String, Object>> getManifestArtifacts(@PathVariable("name") String name) {
+ return keelService.getManifestArtifacts(name);
+ }
+
@ApiOperation(
value = "Create or update a delivery config manifest",
response = DeliveryConfig.class)


diff:
-FROM alpine:3.10
+FROM alpine:3.11
MAINTAINER delivery-engineering@netflix.com
COPY --from=compile /compiled_sources/gate-web/build/install/gate /opt/gate
RUN apk --no-cache add --update bash openjdk8-jre

original_message: chore(release): update the containers to Alpine 3.11 (#998)


message: feat(managed): specify locations at the environment level

diff:
@@ -26,4 +26,5 @@ public class Environment {
Collection<Resource> resources;
Collection<Map<String, Object>> constraints;
Collection<Notification> notifications;
+ Map<String, Object> locations;
}


diff:
@@ -22,8 +22,10 @@ import lombok.Data;
@Data
public class DeliveryConfig {
+ String apiVersion;
String name;
String application;
+ String serviceAccount;
Collection<Map<String, Object>> artifacts;
Collection<Environment> environments;
}

diff:
+/*
+ * Copyright 2020 Netflix, Inc.
+ *
+ * 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.
+ */
+
+package com.netflix.spinnaker.gate.model.manageddelivery;
+
+import com.fasterxml.jackson.databind.ObjectMapper
+import spock.lang.Specification
+
+class DeliveryConfigSpec extends Specification {
+
+ private ObjectMapper mapper = new ObjectMapper()
+
+ def "apiVersion is optional"() {
+ given:
+ def manifest = [
+ name : "my-manifest",
+ application : "fnord",
+ serviceAccount: "gate@spinnaker.io"
+ ]
+ def json = mapper.writeValueAsString(manifest)
+
+ when:
+ def deserialized = mapper.readValue(json, DeliveryConfig.class)
+
+ then:
+ noExceptionThrown()
+
+ and:
+ deserialized.apiVersion == null
+ }
+
+ def "apiVersion can be specified"() {
+ given:
+ def manifest = [
+ apiVersion : "spinnaker.keel/v2",
+ name : "my-manifest",
+ application : "fnord",
+ serviceAccount: "gate@spinnaker.io"
+ ]
+ def json = mapper.writeValueAsString(manifest)
+
+ when:
+ def deserialized = mapper.readValue(json, DeliveryConfig.class)
+
+ then:
+ noExceptionThrown()
+
+ and:
+ deserialized.apiVersion == manifest.apiVersion
+ }
+}

original_message: chore(managed): two new properties on DeliveryConfig (#1027)


diff:
@@ -17,6 +17,7 @@ package com.netflix.spinnaker.gate.plugins
import com.netflix.spectator.api.Registry
import org.slf4j.LoggerFactory
+import java.io.File
/**
* Provides Deck with means of discovering what plugins it needs to download and a standard interface for
@@ -51,7 +52,7 @@ class DeckPluginService(
* If the plugin does not exist on the filesystem, it will be downloaded and cached to a standard location so that
* subsequent asset requests for the plugin version will be faster.
*/
- fun getPluginAsset(pluginId: String, pluginVersion: String, assetPath: String): String? {
+ fun getPluginAsset(pluginId: String, pluginVersion: String, assetPath: String): PluginAsset? {
if (!pluginCache.isCachePopulated()) {
throw CacheNotReadyException()
}
@@ -66,6 +67,28 @@ class DeckPluginService(
}
registry.counter(assetHitsId).increment()
- return localAsset.readText()
+ return PluginAsset.from(localAsset)
+ }
+
+ data class PluginAsset(val contentType: String, val content: String) {
+
+ companion object {
+ private val log by lazy { LoggerFactory.getLogger(PluginAsset::class.java) }
+
+ fun from(file: File): PluginAsset {
+ return PluginAsset(
+ contentType = when {
+ file.toString().endsWith(".js") -> { "application/javascript" }
+ file.toString().endsWith(".css") -> { "text/css" }
+ file.toString().endsWith(".html") -> { "text/html" }
+ else -> {
+ log.warn("Unhandled file extension to content-type mapping for file `{}`, falling back to text/plain", file.toString())
+ "text/plain"
+ }
+ },
+ content = file.readText()
+ )
+ }
+ }
}
}

diff:
@@ -17,12 +17,15 @@ package com.netflix.spinnaker.gate.plugins
import com.netflix.spinnaker.kork.web.exceptions.NotFoundException
import io.swagger.annotations.ApiOperation
+import org.springframework.http.CacheControl
import org.springframework.http.HttpStatus
+import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.ExceptionHandler
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
+import java.util.concurrent.TimeUnit
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
@@ -44,9 +47,19 @@ class DeckPluginsController(
@PathVariable pluginId: String,
@PathVariable pluginVersion: String,
@PathVariable asset: String
- ): String {
- return deckPluginService.getPluginAsset(pluginId, pluginVersion, asset)
- ?: throw NotFoundException("Unable to find asset for plugin version")
+ ): ResponseEntity<String> {
+ val pluginAsset = deckPluginService.getPluginAsset(pluginId, pluginVersion, asset) ?: throw NotFoundException("Unable to find asset for plugin version")
+
+ return ResponseEntity.ok()
+ .header("Content-Type", pluginAsset.contentType)
+ .header("Cache-Control",
+ CacheControl
+ .maxAge(1, TimeUnit.DAYS)
+ .mustRevalidate()
+ .cachePrivate()
+ .headerValue
+ )
+ .body(pluginAsset.content)
}
@ExceptionHandler(CacheNotReadyException::class)

original_message: feat(plugins): Deck plugin content-type negotation and cache-control configuration (#1040)


diff:
@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
- java-version: 8
+ java-version: 11
- name: Build
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}

diff:
@@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
- java-version: 8
+ java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle

diff:
@@ -14,7 +14,7 @@ jobs:
- run: git fetch --prune --unshallow
- uses: actions/setup-java@v1
with:
- java-version: 8
+ java-version: 11
- name: Assemble release info
id: release_info
env:

diff:
-FROM openjdk:8
+FROM openjdk:11
MAINTAINER sig-platform@spinnaker.io
ENV GRADLE_USER_HOME /workspace/.gradle
ENV GRADLE_OPTS -Xmx2048m

original_message: chore(java11): compile with Java 11 (but using -source 8 -target 8) (#1108)


diff:
@@ -11,12 +11,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
+ # Install Java 8 for cross-compilation support. Setting it up before
+ # Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
- name: Build
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace
+ run: ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace

diff:
@@ -7,9 +7,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
+ # Install Java 8 for cross-compilation support. Setting it up before
+ # Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle

diff:
@@ -12,9 +12,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
+ # Install Java 8 for cross-compilation support. Setting it up before
+ # Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
+ - uses: actions/setup-java@v1
+ with:
+ java-version: 11
- name: Assemble release info
id: release_info
env:
@@ -31,7 +36,7 @@ jobs:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
run: |
- ./gradlew -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate
+ ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate
- name: Release build
if: steps.release_info.outputs.IS_CANDIDATE == 'false'
env:
@@ -39,7 +44,7 @@ jobs:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
run: |
- ./gradlew -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final
+ ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final
- name: Create release
if: steps.release_info.outputs.SKIP_RELEASE == 'false'
uses: actions/create-release@v1

diff:
-FROM openjdk:8
+FROM alpine:3.11
+RUN apk add --update \
+ openjdk11 \
+ openjdk8 \
+ && rm -rf /var/cache/apk
MAINTAINER sig-platform@spinnaker.io
+ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
+ENV JDK_18 /usr/lib/jvm/java-1.8-openjdk
ENV GRADLE_USER_HOME /workspace/.gradle
-ENV GRADLE_OPTS -Xmx2048m
+ENV GRADLE_OPTS -Xmx4g
CMD ./gradlew gate-web:installDist -x test

diff:
fiatVersion=1.17.7
enablePublishing=false
korkVersion=7.29.0
-spinnakerGradleVersion=7.0.1
+spinnakerGradleVersion=7.8.0
org.gradle.parallel=true
includeProviders=basic,iap,ldap,oauth2,saml,x509

original_message: chore(java11): Compile with Java 11 (but targeting Java 8) (#1118)


message:
chore(java11): Turn on the cross-compiler plugin in Dockerfile.compile
This got missed because my script tries to add it before `--no-daemon`.
So go ahead and add that too, for consistency and because otherwise
GRADLE_OPTS does nothing useful.

diff:
@@ -8,4 +8,4 @@ ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk
ENV JDK_18 /usr/lib/jvm/java-1.8-openjdk
ENV GRADLE_USER_HOME /workspace/.gradle
ENV GRADLE_OPTS -Xmx4g
-CMD ./gradlew gate-web:installDist -x test
+CMD ./gradlew --no-daemon -PenableCrossCompilerPlugin=true gate-web:installDist -x test

original_message:
chore(java11): Turn on the cross-compiler plugin in Dockerfile.compile (#1119)

This got missed because my script tries to add it before `--no-daemon`.
So go ahead and add that too, for consistency and because otherwise
GRADLE_OPTS does nothing useful.


diff:
package com.netflix.spinnaker.gate.plugins.deck
import com.netflix.spectator.api.Registry
+import com.netflix.spinnaker.kork.plugins.SpringStrictPluginLoaderStatusProvider
import com.netflix.spinnaker.kork.plugins.bundle.PluginBundleExtractor
import com.netflix.spinnaker.kork.plugins.update.SpinnakerUpdateManager
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
@@ -32,9 +33,10 @@ open class DeckPluginConfiguration {
@Bean
open fun deckPluginCache(
updateManager: SpinnakerUpdateManager,
- registry: Registry
+ registry: Registry,
+ springStrictPluginLoaderStatusProvider: SpringStrictPluginLoaderStatusProvider
): DeckPluginCache =
- DeckPluginCache(updateManager, PluginBundleExtractor(), registry)
+ DeckPluginCache(updateManager, PluginBundleExtractor(springStrictPluginLoaderStatusProvider), registry)
@Bean
open fun deckPluginService(

diff:
fiatVersion=1.18.0
enablePublishing=false
spinnakerGradleVersion=7.8.0
-korkVersion=7.29.0
+korkVersion=7.31.1
includeProviders=basic,iap,ldap,oauth2,saml,x509
org.gradle.parallel=true

original_message: chore(dependencies): Bump kork to 7.31.1 and fixup PluginBundleExtractor instantiation (#1124)


message:
chore(GHA PR build): turn on the cross compiler here too
Not sure why I missed this before. I suppose just because it wasn't needed. In any event, I updated my script to add this going forward.

diff:
@@ -24,4 +24,4 @@ jobs:
- name: Build
env:
GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew build javadoc
+ run: ./gradlew -PenableCrossCompilerPlugin=true build javadoc

original_message:
chore(GHA PR build): turn on the cross compiler here too (#1131)

Not sure why I missed this before. I suppose just because it wasn't needed. In any event, I updated my script to add this going forward.


diff:
+apply from: "${project.rootDir}/gradle/kotlin.gradle"
+apply from: "${project.rootDir}/gradle/kotlin-test.gradle"
+
+dependencies {
+ implementation(project(":gate-api"))
+
+ testImplementation(project(":gate-web"))
+ testImplementation(project(":gate-core"))
+
+ testImplementation("com.netflix.spinnaker.kork:kork-plugins")
+ testImplementation("com.netflix.spinnaker.kork:kork-plugins-tck")
+
+ testRuntimeOnly("org.junit.platform:junit-platform-launcher")
+ testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
+}
+
+test {
+ // Without filtering down to a specific test, the test task fails.
+ // It fails because the Gate Main class package does not have an Implementation-Version set.
+ //TODO(jonsie): Determine why and how we can remove this.
+ filter {
+ includeTestsMatching "com.netflix.spinnaker.gate.plugins.test.GatePluginsTest"
+ }
+
+ useJUnitPlatform {
+ includeEngines("junit-jupiter", "junit-vintage")
+ }
+}

diff:
+/*
+ * Copyright 2020 Netflix, Inc.
+ *
+ * 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.
+ */
+
+package com.netflix.spinnaker.gate.plugins
+
+import com.netflix.spinnaker.gate.api.extension.ApiExtension
+import com.netflix.spinnaker.gate.api.extension.HttpRequest
+import com.netflix.spinnaker.gate.api.extension.HttpResponse
+import com.netflix.spinnaker.kork.plugins.api.ExtensionConfiguration
+import com.netflix.spinnaker.kork.plugins.api.PluginSdks
+import javax.annotation.Nonnull
+import org.pf4j.Extension
+
+@Extension
+class GateApiExtension(
+ private val pluginSdks: PluginSdks,
+ private val apiExtensionConfigProperties: ApiExtensionConfigProperties
+) : ApiExtension {
+
+ override fun handles(@Nonnull httpRequest: HttpRequest): Boolean {
+ return supportedGet(httpRequest) || supportedPost(httpRequest)
+ }
+
+ override fun handle(@Nonnull httpRequest: HttpRequest): HttpResponse {
+ if (supportedGet(httpRequest)) {
+ return get()
+ }
+ return echo(httpRequest)
+ }
+
+ private fun supportedGet(@Nonnull httpRequest: HttpRequest): Boolean {
+ return httpRequest.method.equals("GET", ignoreCase = true) &&
+ httpRequest.requestURI.endsWith("")
+ }
+
+ private fun supportedPost(@Nonnull httpRequest: HttpRequest): Boolean {
+ return httpRequest.method.equals("PUT", ignoreCase = true) &&
+ httpRequest.requestURI.endsWith("/echo")
+ }
+
+ private fun get(): HttpResponse {
+ return HttpResponse.of(204, emptyMap(), null)
+ }
+
+ private fun echo(@Nonnull httpRequest: HttpRequest): HttpResponse {
+ val echo = httpRequest.parameters["parameter"]
+ return HttpResponse.of(200, emptyMap(), echo)
+ }
+
+ override fun id(): String {
+ return apiExtensionConfigProperties.id
+ }
+}
+
+@ExtensionConfiguration("api-extension")
+class ApiExtensionConfigProperties {
+ var id: String = "test"
+}

diff:
+/*
+ * Copyright 2020 Netflix, Inc.
+ *
+ * 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.
+ */
+
+package com.netflix.spinnaker.gate.plugins
+
+import org.pf4j.Plugin
+import org.pf4j.PluginWrapper
+
+class GatePlugin(pluginWrapper: PluginWrapper) : Plugin(pluginWrapper)

diff:
+/*
+ * Copyright 2020 Netflix, Inc.
+ *
+ * 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.
+ */
+
+package com.netflix.spinnaker.gate.plugins.test
+
+import com.netflix.spinnaker.gate.Main
+import com.netflix.spinnaker.gate.plugins.GateApiExtension
+import com.netflix.spinnaker.gate.plugins.GatePlugin
+import com.netflix.spinnaker.kork.plugins.SpinnakerPluginManager
+import com.netflix.spinnaker.kork.plugins.internal.PluginJar
+import com.netflix.spinnaker.kork.plugins.tck.PluginsTckFixture
+import java.io.File
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
+import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.boot.test.context.TestConfiguration
+import org.springframework.test.context.ContextConfiguration
+import org.springframework.test.context.TestPropertySource
+import org.springframework.test.web.servlet.MockMvc
+
+class GatePluginsFixture : PluginsTckFixture, GateTestService() {
+
+ final override val plugins = File("build/plugins")
+
+ final override val enabledPlugin: PluginJar
+ final override val disabledPlugin: PluginJar
+ final override val versionNotSupportedPlugin: PluginJar
+
+ override val extensionClassNames: MutableList<String> = mutableListOf(
+ GateApiExtension::class.java.name
+ )
+
+ final override fun buildPlugin(pluginId: String, systemVersionRequirement: String): PluginJar {
+ return PluginJar.Builder(plugins.toPath().resolve("$pluginId.jar"), pluginId)
+ .pluginClass(GatePlugin::class.java.name)
+ .pluginVersion("1.0.0")
+ .manifestAttribute("Plugin-Requires", "gate$systemVersionRequirement")
+ .extensions(extensionClassNames)
+ .build()
+ }
+
+ @Autowired
+ override lateinit var spinnakerPluginManager: SpinnakerPluginManager
+
+ @Autowired
+ lateinit var mockMvc: MockMvc
+
+ init {
+ plugins.delete()
+ plugins.mkdir()
+ enabledPlugin = buildPlugin("com.netflix.gate.enabled.plugin", ">=1.0.0")
+ disabledPlugin = buildPlugin("com.netflix.gate.disabled.plugin", ">=1.0.0")
+ versionNotSupportedPlugin = buildPlugin("com.netflix.gate.version.not.supported.plugin", ">=2.0.0")
+ }
+}
+
+@SpringBootTest(classes = [Main::class])
+@ContextConfiguration(classes = [PluginTestConfiguration::class])
+@TestPropertySource(properties = ["spring.config.location=classpath:gate-plugins-test.yml"])
+@AutoConfigureMockMvc
+abstract class GateTestService
+
+@TestConfiguration
+internal open class PluginTestConfiguration

diff:
+/*
+ * Copyright 2020 Netflix, Inc.
+ *
+ * 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.
+ */
+
+package com.netflix.spinnaker.gate.plugins.test
+
+import com.netflix.spinnaker.kork.plugins.tck.PluginsTck
+import com.netflix.spinnaker.kork.plugins.tck.serviceFixture
+import dev.minutest.rootContext
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put
+import strikt.api.expect
+import strikt.assertions.contains
+import strikt.assertions.isEqualTo
+
+class GatePluginsTest : PluginsTck<GatePluginsFixture>() {
+
+ fun tests() = rootContext<GatePluginsFixture> {
+ context("a gate integration test environment and a gate plugin") {
+ serviceFixture {
+ GatePluginsFixture()
+ }
+
+ defaultPluginTests()
+
+ test("Extension supports GET") {
+ val response = mockMvc.perform(get("/extensions/test"))
+ .andReturn()
+ .response
+
+ expect {
+ that(response.status).isEqualTo(204)
+ }
+ }
+
+ test("Extension supports PUT and echoes content") {
+ val response = mockMvc.perform(put("/extensions/test/echo?parameter=foo"))
+ .andReturn()
+ .response
+
+ expect {
+ that(response.status).isEqualTo(200)
+ that(response.contentAsString).contains("foo")
+ }
+ }
+
+ test("Unsupported HTTP method results in a 404") {
+ val response = mockMvc.perform(post("/extensions/test"))
+ .andReturn()
+ .response
+
+ expect {
+ that(response.status).isEqualTo(404)
+ }
+ }
+ }
+ }
+}

diff:
+spring:
+ application:
+ name: gate
+
+services:
+ clouddriver.baseUrl: "http://localhost:7002"
+
+ deck.baseUrl: "http://localhost:9000"
+
+ echo.enabled: false
+
+ fiat.enabled: false
+
+ front50.baseUrl: "http://localhost:8080"
+
+ igor.enabled: false
+
+ kayenta.enabled: false
+
+ rosco.enabled: false
+
+ orca.baseUrl: "http://localhost:8083"
+
+ mine.enabled: false
+
+ swabbie.enabled: false
+
+spinnaker:
+ extensibility:
+ plugins-root-path: build/plugins
+ plugins:
+ com.netflix.gate.enabled.plugin:
+ enabled: true
+ com.netflix.gate.disabled.plugin:
+ enabled: false
+ com.netflix.gate.version.not.supported.plugin:
+ enabled: true

diff:
@@ -75,3 +75,15 @@ configurations.all {
exclude group: 'javax.servlet', module: 'servlet-api'
exclude group: "org.slf4j", module: "slf4j-log4j12"
}
+
+test {
+ //The Implementation-Version is set in the MANIFEST.MF for the JAR produced via testing so that
+ //assertions can be made against the version (see gate-plugins-test, for example).
+ jar {
+ manifest {
+ attributes(
+ 'Implementation-Version': '1.0.0'
+ )
+ }
+ }
+}

diff:
@@ -18,24 +18,25 @@ package com.netflix.spinnaker.gate
import com.netflix.spinnaker.hystrix.spectator.HystrixSpectatorConfig
import org.springframework.boot.actuate.autoconfigure.ldap.LdapHealthContributorAutoConfiguration
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration
+import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.boot.context.properties.EnableConfigurationProperties
-import org.springframework.context.annotation.ComponentScan
-import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Import
import org.springframework.scheduling.annotation.EnableAsync
@EnableAsync
-@Configuration
@EnableConfigurationProperties
@Import([HystrixSpectatorConfig])
-@ComponentScan(["com.netflix.spinnaker.gate", "com.netflix.spinnaker.config"])
-@EnableAutoConfiguration(exclude = [GroovyTemplateAutoConfiguration,
- GsonAutoConfiguration,
- LdapHealthContributorAutoConfiguration])
+@SpringBootApplication(
+ scanBasePackages = [
+ "com.netflix.spinnaker.gate",
+ "com.netflix.spinnaker.config"
+ ],
+ exclude = [GroovyTemplateAutoConfiguration, GsonAutoConfiguration,
+ LdapHealthContributorAutoConfiguration]
+)
class Main {
static final Map<String, String> DEFAULT_PROPS = [

diff:
@@ -19,6 +19,7 @@ rootProject.name = "gate"
include "gate-api",
"gate-core",
"gate-plugins",
+ "gate-plugins-test",
"gate-basic",
"gate-bom",
"gate-iap",

original_message: feat(plugins): Add gate-plugins-test module (#1145)


diff:
@@ -6,6 +6,9 @@ on:
- master
- version-*
+env:
+ GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
+
jobs:
branch-build:
# Only run this on repositories in the 'spinnaker' org, not on forks.
@@ -21,9 +24,11 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 11
+ - uses: actions/cache@v1
+ with:
+ path: ~/.gradle
+ key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
+ restore-keys: |
+ ${{ runner.os }}-gradle-
- name: Build
- env:
- BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
- BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace
+ run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace

diff:
@@ -2,6 +2,9 @@ name: PR Build
on: [ pull_request ]
+env:
+ GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
+
jobs:
build:
runs-on: ubuntu-latest
@@ -22,6 +25,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
- env:
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew -PenableCrossCompilerPlugin=true build javadoc
+ run: ./gradlew -PenableCrossCompilerPlugin=true build

diff:
@@ -6,6 +6,9 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
+env:
+ GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
+
jobs:
release:
runs-on: ubuntu-latest
@@ -25,26 +28,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- . .github/workflows/release_info.sh ${{ github.event.repository.name }}
+ . .github/workflows/release_info.sh ${{ github.event.repository.full_name }}
echo ::set-output name=CHANGELOG::$(echo -e "${CHANGELOG}")
echo ::set-output name=SKIP_RELEASE::${SKIP_RELEASE}
echo ::set-output name=IS_CANDIDATE::${IS_CANDIDATE}
- - name: Candidate build
- if: steps.release_info.outputs.IS_CANDIDATE == 'true'
- env:
- BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
- BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: |
- ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate
+ echo ::set-output name=RELEASE_VERSION::${RELEASE_VERSION}
- name: Release build
if: steps.release_info.outputs.IS_CANDIDATE == 'false'
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
+ RELEASE_VERSION: ${{ steps.release_info.outputs.RELEASE_VERSION }}
run: |
- ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final
+ ./gradlew --info -Pversion="${RELEASE_VERSION}" -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" publish
- name: Create release
if: steps.release_info.outputs.SKIP_RELEASE == 'false'
uses: actions/create-release@v1

diff:
#!/bin/bash -x
# Only look to the latest release to determine the previous tag -- this allows us to skip unsupported tag formats (like `version-1.0.0`)
-export PREVIOUS_TAG=`curl --silent "https://api.github.com/repos/spinnaker/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
+export PREVIOUS_TAG=`curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
echo "PREVIOUS_TAG=$PREVIOUS_TAG"
+
export NEW_TAG=${GITHUB_REF/refs\/tags\//}
echo "NEW_TAG=$NEW_TAG"
export CHANGELOG=`git log $NEW_TAG...$PREVIOUS_TAG --oneline`
@@ -29,3 +30,6 @@ SEMVER_REGEX="\
# Used in downstream steps to determine if the release should be marked as a "prerelease" and if the build should build candidate release artifacts
export IS_CANDIDATE=`[[ $NEW_TAG =~ $SEMVER_REGEX && ! -z ${BASH_REMATCH[4]} ]] && echo "true" || echo "false"`
+
+export RELEASE_VERSION=`[[ $NEW_TAG =~ $SEMVER_REGEX ]] && echo "${NEW_TAG:1}" || echo "${NEW_TAG}"`
+echo "RELEASE_VERSION=$RELEASE_VERSION"

diff:
-buildscript {
- ext {
- kotlinVersion = "1.3.71"
- }
- repositories {
- jcenter()
- maven { url "https://spinnaker.bintray.com/gradle" }
- maven { url "https://plugins.gradle.org/m2/" }
- }
- dependencies {
- classpath "com.netflix.spinnaker.gradle:spinnaker-dev-plugin:$spinnakerGradleVersion"
- classpath "com.netflix.nebula:nebula-kotlin-plugin:$kotlinVersion"
- if (Boolean.valueOf(enablePublishing)) {
- classpath "com.netflix.spinnaker.gradle:spinnaker-gradle-project:$spinnakerGradleVersion"
-// TODO: nebula-publishing-plugin version override should be removed as soon as spinnaker-gradle-project is updated
-// this override is needed to omit compileOnly dependencies from generated pom.xml
- classpath "com.netflix.nebula:nebula-publishing-plugin:12.0.1"
- }
- }
+plugins {
+ id 'io.spinnaker.project' version "$spinnakerGradleVersion" apply false
+ id "nebula.kotlin" version "$kotlinVersion" apply false
+ id "org.jetbrains.kotlin.plugin.allopen" version "$kotlinVersion" apply false
+ id "org.jetbrains.dokka" version "0.10.1" apply false
}
allprojects {
+ apply plugin: 'io.spinnaker.project'
+
group = "com.netflix.spinnaker.gate"
- apply plugin: 'spinnaker.base-project'
- if (Boolean.valueOf(enablePublishing)) {
- apply plugin: 'spinnaker.project'
- }
if (name != "gate-bom") {
apply plugin: 'java-library'

diff:
@@ -21,17 +21,6 @@ javaPlatform {
allowDependencies()
}
-
-if (Boolean.valueOf(enablePublishing)) {
- publishing {
- publications {
- nebula(MavenPublication) {
- from components.javaPlatform
- }
- }
- }
-}
-
dependencies {
api(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion"))

diff:
-apply plugin: 'spinnaker.application'
+apply plugin: 'io.spinnaker.package'
ext {
springConfigLocation = System.getProperty('spring.config.additional-location', "${System.getProperty('user.home')}/.spinnaker/")

diff:
@@ -3,4 +3,5 @@ fiatVersion=1.18.3
includeProviders=basic,iap,ldap,oauth2,saml,x509
korkVersion=7.37.0
org.gradle.parallel=true
-spinnakerGradleVersion=7.11.6
+spinnakerGradleVersion=8.0.0-rc.3
+kotlinVersion=1.3.71

original_message: chore(build): update to newer spinnaker project plugin (#1159)


diff:
package com.netflix.spinnaker.gate.api.extension;
import com.netflix.spinnaker.kork.annotations.Alpha;
+import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint;
import java.util.Collections;
import javax.annotation.Nonnull;
-import org.pf4j.ExtensionPoint;
/**
* An {@code ExtensionPoint} that allows for a new api to be exposed under a common
* `/extensions/{id}` path.
*/
@Alpha
-public interface ApiExtension extends ExtensionPoint {
+public interface ApiExtension extends SpinnakerExtensionPoint {
@Nonnull
String id();

original_message: chore(plugins): Replace PF4J ExtensionPoint with SpinnakerExtensionPoint (#1183)


diff:
@@ -88,9 +88,14 @@ test {
//assertions can be made against the version (see gate-plugins-test, for example).
jar {
manifest {
+ String implementationVersion = getAttributes()["Implementation-Version"]
+ if (implementationVersion == null
+ || implementationVersion.isEmpty()
+ || implementationVersion == "undefined") {
attributes(
'Implementation-Version': '1.0.0'
)
}
}
}
+}

original_message: fix(build): Do not set Implementation-Version in test JAR if already set to a valid version (#1244)


diff:
@@ -10,16 +10,16 @@ allprojects {
group = "com.netflix.spinnaker.gate"
- if (name != "gate-bom") {
- apply plugin: 'java-library'
- apply plugin: 'groovy'
-
if ([korkVersion, fiatVersion].find { it.endsWith('-SNAPSHOT') }) {
repositories {
mavenLocal()
}
}
+ if (name != "gate-bom" && name != "gate-api") {
+ apply plugin: 'java-library'
+ apply plugin: 'groovy'
+
repositories {
maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
maven { url 'https://repository.mulesoft.org/releases/' }
@@ -52,6 +52,7 @@ allprojects {
exclude group: 'javax.servlet', module: 'servlet-api'
exclude group: 'javax.servlet', module: 'javax.servlet-api'
}
+ }
tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
@@ -65,6 +66,5 @@ allprojects {
}
}
}
-}
defaultTasks ':gate-web:run'

diff:
@@ -17,6 +17,8 @@ apply plugin: 'java-library'
dependencies {
implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")
+ annotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")
+
api "com.netflix.spinnaker.kork:kork-plugins-api"
api "com.netflix.spinnaker.kork:kork-annotations"

original_message: fix(plugins): Do not configure gate-api with dependencies from subproject configuration in root build.gradle (#1260)