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

atlasexec/migrate-lint: added support for --web #18

Merged
merged 15 commits into from
Sep 27, 2023

Conversation

dorav
Copy link
Contributor

@dorav dorav commented Sep 26, 2023

No description provided.

@dorav dorav requested a review from rotemtam September 26, 2023 06:28
.gitignore Outdated Show resolved Hide resolved
@dorav dorav requested a review from a8m September 26, 2023 08:19
@dorav dorav force-pushed the add_base_and_web_lint_parameters branch from b149f17 to c28666c Compare September 26, 2023 14:54
@dorav dorav changed the title atlasexec/lint: added the base and web params atlasexec/migrate-lint: added support for --web Sep 26, 2023
@dorav dorav force-pushed the add_base_and_web_lint_parameters branch from c28666c to a4a11cf Compare September 26, 2023 14:58
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas.go Outdated Show resolved Hide resolved
atlasexec/atlas.go Outdated Show resolved Hide resolved
atlasexec/atlas.go Outdated Show resolved Hide resolved
atlasexec/atlas.go Outdated Show resolved Hide resolved
atlasexec/atlas.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
atlasexec/atlas_test.go Outdated Show resolved Hide resolved
@dorav dorav requested a review from a8m September 27, 2023 06:28
Comment on lines 154 to 172
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))
Copy link
Member

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

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" } } }`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_, _ = 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)

Copy link
Member

@a8m a8m left a 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

@dorav
Copy link
Contributor Author

dorav commented Sep 27, 2023

@a8m Yalla, let's merge

@dorav dorav requested a review from a8m September 27, 2023 08:33
@a8m a8m merged commit e37b297 into master Sep 27, 2023
2 checks passed
@a8m a8m deleted the add_base_and_web_lint_parameters branch September 27, 2023 09:20
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.

3 participants