Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Fix dependency declaration of Prometheus #4699

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

ctron
Copy link
Contributor

@ctron ctron commented Jun 8, 2020

This is battle between Golang authors and Prometheus authors (probably some others as well).

Golang requires semantic versioning, and Prometheus doesn't want submit to those rules:

You can still put a commit has into the go.mod file as version, but that gets translated to into a version from the past (for 2.15.2 prometheus this will resolve into 2.3.x or 1.8.x).

The solution to all of this insanity is, to declare the version you had in mind in the "requires" section. And then add a mapping entry into the "replace" section, pointing to the actual version, using a commit hash and the "v0.0.0" version.

Type of change

  • Rant
  • Bugfix

Description

Checklist

  • Update/write design documentation in ./documentation/design
  • Write tests and make sure they pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md

@ctron ctron requested review from lulf and k-wall June 8, 2020 11:42
Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but lets keep it serious in the commit messages (although I 100% agree with it :) )

This is battle between Golang authors and Prometheus authors (probably
some others as well).

Golang requires semantic versioning, and Prometheus doesn't want submit
to those rules:

* With Go 1.13 can no longer flag versions as incompatible, if the have
  a 'go.mod' file in their repository:
golang/go#35732
* Dropping the '+incompatible' suffix is not possible, because the
  module author (Prometheus) would need to add the suffix '/v2'
  to their module. Otherwise you run into:
golang/go#35732 (comment)
* Prometheus doesn't care about Golang's idea of versioning and simply
  ignores it:
prometheus/prometheus#6048 (comment)

You can still put a commit has into the go.mod file as version, but that
gets translated to into a version from the past (for 2.15.2 prometheus
this will resolve into 2.3.x or 1.8.x).

The solution to all of this insanity is, to declare the version you had
in mind in the "requires" section. And then add a mapping entry into
the "replace" section, pointing to the actual version, using a commit
hash and the "v0.0.0" version.
@ctron ctron requested a review from lulf June 8, 2020 12:57
@lulf lulf merged commit 81a5675 into EnMasseProject:master Jun 8, 2020
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.

2 participants