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

Add maintenance listing #982

Merged
merged 15 commits into from
Jul 13, 2023
Merged

Add maintenance listing #982

merged 15 commits into from
Jul 13, 2023

Conversation

SCedricThomas
Copy link
Contributor

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md

fix #968

@SCedricThomas SCedricThomas self-assigned this Jul 4, 2023
@SCedricThomas
Copy link
Contributor Author

image

@curzolapierre curzolapierre mentioned this pull request Jul 5, 2023
2 tasks
Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Sorry for the review when the PR is only in draft, but I thought of it so here it is.

db/maintenance/list.go Outdated Show resolved Hide resolved
db/maintenance/list.go Outdated Show resolved Hide resolved
@SCedricThomas
Copy link
Contributor Author

Waiting for go-scalingo release

Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Mostly nitpicking, otherwise LGTM

db/maintenance/list.go Outdated Show resolved Hide resolved
db/maintenance/list.go Outdated Show resolved Hide resolved
cmd/maintenance.go Outdated Show resolved Hide resolved
Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Could you please rebase on master?
I've suggested the change you probably need to do after the rebase.
Due to this PR: #983

cmd/maintenance.go Outdated Show resolved Hide resolved
PerPage: c.Int("per-page"),
})
if err != nil {
errorQuitWithHelpMessage(err, c, "database-maintenance-list")
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that we want to show help message here.
E.g. in case of error when calling DatabaseListMaintenance, just print the error message should be enough

@SCedricThomas SCedricThomas marked this pull request as ready for review July 13, 2023 08:55
Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Just some nitpicks otherwise LGTM

)

func List(ctx context.Context, app string, addonName string, paginationOpts scalingo.PaginationOpts) error {
caser := cases.Title(language.English)
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity why are you using cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

caser := cases.Title(language.English)
c, err := config.ScalingoClient(ctx)
if err != nil {
return errgo.Notef(err, "get Scalingo client")
Copy link
Member

Choose a reason for hiding this comment

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

We should use Wrap now, according to our doc


response, err := c.DatabaseListMaintenance(ctx, app, addonName, paginationOpts)
if err != nil {
return errgo.Notef(err, "list the database maintenance")
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Suggested change
return errgo.Notef(err, "list the database maintenance")
return errgo.Wrap(err, "list the database maintenance")

Comment on lines 47 to 50
caser.String(string(maintenance.Type)),
startedAt,
endedAt,
caser.String(string(maintenance.Status)),
Copy link
Member

Choose a reason for hiding this comment

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

I didn't know the Title method, thanks for sharing 👍

But I don't think that we want to format these fields (i.e. Type, Status). Becuase IMO they should be formatted like they are in platform side in case of issue in user side. That would simplify our investigation, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I respected the user story, but you may be right here: https://github.com/Scalingo/project-items/issues/285

@SCedricThomas SCedricThomas merged commit f1e0b36 into master Jul 13, 2023
@SCedricThomas SCedricThomas deleted the feat/968/maintenance-listing branch July 13, 2023 13: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.

Maintenance listing
2 participants