Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo: update prometheus to 0.7 #125

Merged
merged 8 commits into from
Jun 24, 2019

Conversation

lucab
Copy link
Contributor

@lucab lucab commented Jun 20, 2019

This updates prometheus library to latest version.

/cc @steveej

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 20, 2019
Copy link
Contributor

@steveej steveej left a comment

Choose a reason for hiding this comment

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

I'd feel more comfortable stamping this if we had metrics tests. Do you have time to work on that within the scope of this PR?

quay/Cargo.toml Outdated
@@ -18,4 +18,4 @@ tokio = "^0.1.14"

[features]
test-net = []
test-net-private = []
Copy link
Contributor

Choose a reason for hiding this comment

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

this change seems unrelated

@lucab
Copy link
Contributor Author

lucab commented Jun 20, 2019

@steveej I think so, but a complete metrics test would require an integration suite. Would a "the metrics handler returns 200 and a non-empty body" test be enough here (maybe with some keyword grepping too)?

@steveej
Copy link
Contributor

steveej commented Jun 20, 2019

@lucab

Would a "the metrics handler returns 200 and a non-empty body" test be enough here

I'm fine with that for this PR 👍

@lucab
Copy link
Contributor Author

lucab commented Jun 21, 2019

@steveej this now comes with tests too, PTAL.

Copy link
Contributor

@steveej steveej left a comment

Choose a reason for hiding this comment

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

I haven't fully gone through here but my general suggestion for all tests is that we use Result like in regular code.

graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Outdated Show resolved Hide resolved
graph-builder/src/status.rs Show resolved Hide resolved
@lucab
Copy link
Contributor Author

lucab commented Jun 21, 2019

@steveej I've updated to use Fallible everywhere in those tests, does it look better now?

Copy link
Contributor

@steveej steveej left a comment

Choose a reason for hiding this comment

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

except for the duplicate common_init* method this looks pretty good, thanks for the tests!

* I went back and forth two twice and they looked the same

policy-engine/src/metrics.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@steveej steveej left a comment

Choose a reason for hiding this comment

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

Since you're using failure in here you can use the ensure!() macro here and elsewhere instead of assert!().

assert!(resp.body().is_binary());

if let actix_web::Body::Binary(body) = resp.body() {
assert!(!body.is_empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're using failure in here you can use the ensure!() macro here and elsewhere instead of assert!()

Copy link
Contributor Author

@lucab lucab Jun 24, 2019

Choose a reason for hiding this comment

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

assert and ensure are not directly interchangeable, as the latter doesn't have fileline information and additional introspection details provided by the former.

I'm sticking to assert for enforcing invariants, but feel free to have a spike ticket to investigate/build a blended ensure+assert_* macro.

@lucab
Copy link
Contributor Author

lucab commented Jun 24, 2019

I've moved shared testing helpers to commons::testing, but kept the assert checks. PTAL.

@steveej
Copy link
Contributor

steveej commented Jun 24, 2019

I've moved shared testing helpers to commons::testing, but kept the assert checks. PTAL.

Thanks for walking the extra mile! 🏃‍♂️

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lucab, steveeJ

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 4dad264 into openshift:master Jun 24, 2019
@lucab lucab deleted the ups/cargo-prom branch June 24, 2019 19:28
wking added a commit to wking/cincinnati that referenced this pull request Nov 5, 2020
In preparation for consuming the 'version' file that graph-data grew
in [1].  This gets us the first main-line commit to include the
'version' file:

  cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782
  2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial

  2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file

[1]: openshift/cincinnati-graph-data#233
wking added a commit to wking/cincinnati that referenced this pull request Nov 5, 2020
Consuming the 'version' file that graph-data grew in [1], so the logs
will contain more useful error messages when the plugin is fed an
incompatible schema version.

Bumping the graph-data commit used for CI moves us to the first
main-line commit to include the 'version' file:

  cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782
  2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial

  2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file

[1]: openshift/cincinnati-graph-data#233
LalatenduMohanty pushed a commit to LalatenduMohanty/cincinnati that referenced this pull request Jan 20, 2021
In preparation for consuming the 'version' file that graph-data grew
in [1].  This gets us the first main-line commit to include the
'version' file:

  cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782
  2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial

  2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file

[1]: openshift/cincinnati-graph-data#233
LalatenduMohanty pushed a commit to LalatenduMohanty/cincinnati that referenced this pull request Jan 20, 2021
Consuming the 'version' file that graph-data grew in [1], so the logs
will contain more useful error messages when the plugin is fed an
incompatible schema version.

Bumping the graph-data commit used for CI moves us to the first
main-line commit to include the 'version' file:

  cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782
  2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial

  2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file

[1]: openshift/cincinnati-graph-data#233
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cincinnati that referenced this pull request Mar 19, 2021
In preparation for consuming the 'version' file that graph-data grew
in [1].  This gets us the first main-line commit to include the
'version' file:

  cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782
  2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial

  2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file

[1]: openshift/cincinnati-graph-data#233
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/cincinnati that referenced this pull request Mar 19, 2021
Consuming the 'version' file that graph-data grew in [1], so the logs
will contain more useful error messages when the plugin is fed an
incompatible schema version.

Bumping the graph-data commit used for CI moves us to the first
main-line commit to include the 'version' file:

  cincinnati-graph-data$ git --no-pager show --date=short --format='%ad %h %s' d980578d2e b87e7c2782
  2020-03-18 d980578 Merge pull request openshift#125 from marun/unique-service-ca-serial

  2020-05-11 b87e7c2 Merge pull request openshift#233 from wking/version-file

[1]: openshift/cincinnati-graph-data#233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants