Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Add support for fetching remote configuration #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abesto
Copy link
Contributor

@abesto abesto commented May 2, 2019

(Note this is on top of #34 )
Fixes #23

This allows defining per-project options in some central location. For convenience PROJECT/MODULE expands to https://openzipkin-contrib.github.io/apache-release-verification/presets/PROJECT/MODULE.yaml; that is, the gh-pages branch of this repo can serve as a central repository of configurations, but anyone is free to distribute their own configs however they like, as long as it's accessible over HTTP or HTTPS.

As a proof of concept I've uploaded https://openzipkin-contrib.github.io/apache-release-verification/presets/zipkin/zipkin.yaml with the following contents:

project: zipkin
module: zipkin
zipname-template: 'apache-{module}{dash_incubating}-{version}-source-release'
github-reponame-template: '{incubator_dash}{module}.git'

That means one can now validate a Zipkin release as such:

python3 src/main.py \
  --version 2.13.0 --gpg-key DA805D02 \
  --git-hash 7c08091d3f8b0428d1d78839d3bef0f6887746f2 \
  --remote-config zipkin/zipkin

The --remote-config option accepts full URLs as well, so zipkin/zipkin is equivalent to https://openzipkin-contrib.github.io/apache-release-verification/presets/zipkin/zipkin.yaml.

Note that --config and --remote-config can appear together (and are resolved in the order they're provided on the command line, with the latter overriding values provided by the former). So this can also be written, given a local zipkin.yaml with the keys version, gpg-key, and git-hash:

python3 src/main.py --config zipkin-2.13.0.yaml --remote-config zipkin/zipkin

A remote-config field in a local config file gets evaluated (but can be overridden via a command-line argument, like everything else specified via a local or remote config file)

When --remote-config is not passed in, we try to infer it as project/module. Unlike explicitly defined --remote-config values, there is no error raised if this inferred remote config file doesn't exist.

@abesto abesto force-pushed the remote-config branch 2 times, most recently from dbd9b43 to 5ab4c47 Compare May 18, 2019 13:03
@abesto
Copy link
Contributor Author

abesto commented May 18, 2019

Alright, I'm now pretty happy with this. It can correctly load config options from a local file, a remote file, and do a best-effort try to get remote config based on the project and module name.

@abesto
Copy link
Contributor Author

abesto commented May 18, 2019

Heads up, I'll be merging this end of next week unless someone stops me. There are many changes here, and we're getting into merge-conflict-nightmare territory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Per-project configurability
1 participant