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

Feat(addons-info): Add addons-info command and documentation #689

Merged
merged 9 commits into from
Nov 3, 2021

Conversation

sihamais
Copy link
Member

@sihamais sihamais commented Nov 2, 2021

Add addons-info command to display addon information :

$ scalingo --app my-app addons-info --addon <addon-id>
+------------------------+--------------------+
| Database Type          | postgresql         |
| Version                | 13.3.0-2           |
| Status                 | running            |
| Plan                   | postgresql-sandbox |
| Force TLS              | activated          |
| Internet Accessibility | disabled           |
+------------------------+--------------------+

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

Fix #578

@sihamais sihamais requested a review from EtienneM November 2, 2021 12:33
Copy link
Member

@EtienneM EtienneM left a comment

Choose a reason for hiding this comment

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

The description of your PR should be Fix #578. With the keyword Fix, GitHub will automatically close the related issue when merging the PR

You forgot to update the CHANGELOG file

README.md Outdated Show resolved Hide resolved
cmd/addons.go Outdated Show resolved Hide resolved
Copy link
Member

@EtienneM EtienneM left a comment

Choose a reason for hiding this comment

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

Can you edit the description of the PR to include an example of execution so that I can see it?

addons/info.go Outdated Show resolved Hide resolved
addons/info.go Outdated Show resolved Hide resolved
addons/info.go Outdated

forceSsl, internetAccess := "disabled", "disabled"
if featuresLen := len(dbInfo.Features); featuresLen > 0 {
if featuresLen == 2 {
Copy link
Member

Choose a reason for hiding this comment

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

This is not really true. There is a possibility that length is greater than 2 and that internet access is enabled.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you know where I can find the list of possible features for a db ? Thought they were only two.

Copy link
Member

Choose a reason for hiding this comment

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

We don't maintain a comprehensive list of features. Do you have access to appsdeck-database code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so.

Copy link
Member

Choose a reason for hiding this comment

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

OK so you don't have access to the full list of features.. 😓

addons/info.go Outdated Show resolved Hide resolved
@sihamais sihamais requested a review from EtienneM November 2, 2021 16:37
CHANGELOG.md Outdated
@@ -2,6 +2,8 @@

### To be Released

* feat(addons-info): add command `addons-info` to display information of an add-on [#578](https://github.com/Scalingo/cli/pull/689)
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
* feat(addons-info): add command `addons-info` to display information of an add-on [#578](https://github.com/Scalingo/cli/pull/689)
* feat(addons-info): add command `addons-info` to display information of an add-on [#689](https://github.com/Scalingo/cli/pull/689)

Copy link
Member

Choose a reason for hiding this comment

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

There is still this one

addons/info.go Outdated
forceSsl = strings.ToLower(dbInfo.Features[i]["status"])
} else if dbInfo.Features[i]["name"] == "publicly-available" {
internetAccess = strings.ToLower(dbInfo.Features[i]["status"])
break
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't break in this condition, there is no guarantee of the features order

Suggested change
break

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually there is, since you cannot make your addon publicly available if SSL isn't enforced, so it has to be after the SSL entry. I've checked. What do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

Even though you supposedly can't enforce Public availability without Force TLS, the order of the features in the array is not guaranteed at all in the code. I can imagine a scenario where this is not the case. For instance, in case of issue with these features, an operator can manually work on the database and the order of features on the database is not guaranteed

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, I'll remove it then. Thanks for the explanation.

@sihamais sihamais requested a review from EtienneM November 3, 2021 09:03
@EtienneM EtienneM removed their request for review November 3, 2021 09:28
@sihamais sihamais merged commit 3ddcf93 into master Nov 3, 2021
@sihamais sihamais deleted the feat/578/addons-info_command branch November 3, 2021 10:01
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.

[Addons] Able to see addon informations
2 participants