-
Notifications
You must be signed in to change notification settings - Fork 237
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
First attempt at adding a fallback option which queries graphQL should the http request fail with status 404 #915
First attempt at adding a fallback option which queries graphQL should the http request fail with status 404 #915
Conversation
@@ -98,7 +98,6 @@ func (c *Client) DoRequest(req *http.Request, resp interface{}) (statusCode int, | |||
}{} | |||
err = json.NewDecoder(httpResp.Body).Decode(&httpError) | |||
if err != nil { | |||
fmt.Printf("failed to decode body: %s", err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been deliberately removed to reduce noise when the fallback legacy path is used for config compilation and validation.
assert.Error(t, err) | ||
assert.Contains(t, err.Error(), "this version of the CLI does not support your instance of server") | ||
}) | ||
// commenting this out - we have a legacy_test.go unit test that covers this behaviour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deliberately commented out for now until we opt for the pinning model.
if statusCode == 404 { | ||
return nil, errors.New("this version of the CLI does not support your instance of server, please refer to https://github.com/CircleCI-Public/circleci-cli for version compatibility") | ||
statusCode, originalErr := c.compileRestClient.DoRequest(req, configCompilationResp) | ||
if statusCode == 404 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the statusCode returned from the request is 404, we want to then attempt to call the legacy GraphQL resolver path.
d2dc832
to
13246b2
Compare
…es and the CLI I've created a more in-depth version compatibility matrix
9bbb5f5
to
d74f84e
Compare
d74f84e
to
7d09d97
Compare
Checklist
=========
Internal Checklist
Changes
=======
Rationale
=========
The decision to opt for pinned versions of the CLI has caused some customer impact and as such, we've opted to change tact such that the config process and validate commands run the new path first and fail back to the legacy path.
Considerations
==============
We're working through testing this now with server 3 and server 4 customers.