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

rules: fix silly mistakes in the rules API #2957

Merged
merged 10 commits into from
Aug 11, 2020

Conversation

GiedriusS
Copy link
Member

@GiedriusS GiedriusS commented Jul 29, 2020

Fixes #2938 and is a follow up to #2925.

Changes:

  • Copying all fields properly to the group-level as well;
  • Set TZ to UTC explicitly in other time.Time fields to avoid a panic;
  • Make sure that RuleGroup always has an empty array in the rules
    field because that's customary and that is what the new React UI
    expects;
  • Remove DeprecatedPartialResponseStrategy so that we wouldn't
    have essentially two fields in the response of /api/v1/rules that could
    potentially show different values because one of them is locked to
    always be WARN.

The new e2e test case tests out the first change written in this list and the last one
is covered by unit tests that were changed to work with these modifications.

Signed-off-by: Giedrius Statkevičius giedriuswork@gmail.com

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Fixes thanos-io#2938 and is a follow up
to thanos-io#2925.

Changes:
* Copying all fields properly to the group-level as well
* Set TZ to UTC explicitly in other `time.Time` fields to avoid a panic
* Make sure that `RuleGroup` always has an empty array in the `rules`
field because that's customary and that is what the new React UI
expects.

Manual testing for now.

Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
It has been marked deprecated for more than 2 months. Remove it finally.

Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
@GiedriusS GiedriusS marked this pull request as ready for review August 3, 2020 17:25
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

looks great @GiedriusS :)) two small comments from my side

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
GiedriusS and others added 3 commits August 10, 2020 22:58
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>

Co-authored-by: Lucas Servén Marín <lserven@gmail.com>
Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>

Co-authored-by: Lucas Servén Marín <lserven@gmail.com>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@@ -73,7 +73,6 @@ message RuleGroup {
google.protobuf.Timestamp last_evaluation = 6 [(gogoproto.jsontag) = "lastEvaluation", (gogoproto.stdtime) = true, (gogoproto.nullable) = false ];

// Thanos specific.
PartialResponseStrategy DeprecatedPartialResponseStrategy = 7 [(gogoproto.jsontag) = "partial_response_strategy"];
Copy link
Member

Choose a reason for hiding this comment

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

Yea, you are right ;p

@bwplotka bwplotka merged commit 600318d into thanos-io:master Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rules HTTP API weirdness: nulls, different values for "same" field, lastEvaluation set to 0000
4 participants