-
Notifications
You must be signed in to change notification settings - Fork 11
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
atlasexec/migrate-lint: added support for --web #18
Conversation
b149f17
to
c28666c
Compare
c28666c
to
a4a11cf
Compare
atlasexec/atlas_test.go
Outdated
tmpl := `atlas { | ||
cloud { | ||
token = "{{ .Token }}" | ||
{{- if .URL }} | ||
url = "{{ .URL }}" | ||
{{- end }} | ||
} | ||
} | ||
env "test" {}` | ||
config := template.Must(template.New("atlashcl").Parse(tmpl)) | ||
templateParams := struct { | ||
URL string | ||
Token string | ||
}{ | ||
URL: srv.URL, | ||
Token: token, | ||
} | ||
var buf bytes.Buffer | ||
require.NoError(t, config.Execute(&buf, templateParams)) |
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.
just use fmt.Sprintf or inject the variable instead with var.url
atlasexec/atlas_test.go
Outdated
var query graphQLQuery | ||
require.NoError(t, json.NewDecoder(r.Body).Decode(&query)) | ||
if strings.Contains(query.Query, "mutation reportMigrationLint") { | ||
_, _ = fmt.Fprint(w, `{ "data": { "reportMigrationLint": { "url": "https://migration-lint-report-url" } } }`) |
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.
_, _ = fmt.Fprint(w, `{ "data": { "reportMigrationLint": { "url": "https://migration-lint-report-url" } } }`) | |
_, err := fmt.Fprint(w, `{ "data": { "reportMigrationLint": { "url": "https://migration-lint-report-url" } } }`) | |
require.NoError(t, err) |
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.
Looks good. I added minor comments before approving
@a8m Yalla, let's merge |
No description provided.