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

CHEF-727 : Version Command on Bastion #7970

Merged
merged 13 commits into from
Jun 21, 2023
Merged

CHEF-727 : Version Command on Bastion #7970

merged 13 commits into from
Jun 21, 2023

Conversation

shanmugapriya-tr
Copy link
Collaborator

@shanmugapriya-tr shanmugapriya-tr commented Jun 19, 2023

🔩 Description: What code changed, and why?

Added code in version.go to enable bastion execution of the command chef-automate version

⛓️ Related Resources

https://chefio.atlassian.net/browse/CHEF-727

👍 Definition of Done

chef-automate version command should run from bastion and display the nodes versions

👟 How to Build and Test the Change

checkout this branch
build components/automate-cli
use the package to test

✅ Checklist

All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

📷 Screenshots, if applicable

Screenshot 2023-06-19 at 11 31 02 PM Screenshot 2023-06-19 at 11 31 10 PM Screenshot 2023-06-19 at 11 31 23 PM

📷

Video Link : Click Here

@netlify
Copy link

netlify bot commented Jun 19, 2023

👷 Deploy Preview for chef-automate processing.

Name Link
🔨 Latest commit 37eca14
🔍 Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/649313b9eadac50008636078

A2VERSIONVERBOSE = "sudo chef-automate version -v "
CSVERSIONCMD = "sudo chef-server-ctl version"
OSGETINFOCURLCMD = "curl -XGET http://localhost:10144"
PGGETVERSIONCURLCMD = "PGPASSWORD=%s hab pkg exec core/postgresql13 psql -U %s -h localhost -p 10145 -d postgres --dbname postgres -tAc 'SELECT version()'"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we have a version constant, what if the version gets changed in future, then this command will not work.

@shanmugapriya-tr shanmugapriya-tr requested a review from a team as a code owner June 20, 2023 06:10
@github-actions github-actions bot added the documentation Anything related to the Automate docs. label Jun 20, 2023
@@ -91,8 +91,8 @@ func newDebugCmd() *cobra.Command {
logLevelCmd.Flags().StringVar(&logLevelCmdFlags.endpoint, "endpoint", "", "The endpoint the service is listening on")
logLevelCmd.Flags().DurationVar(&logLevelCmdFlags.connectionTimeout, "connection-timeout", 0, "Most time to wait to connect to service")

versionCmd.Flags().StringVar(&versionCmdFlags.endpoint, "endpoint", "", "The endpoint the service is listening on")
versionCmd.Flags().DurationVar(&versionCmdFlags.connectionTimeout, "connection-timeout", 0, "Most time to wait to connect to service")
getVersionCmd.Flags().StringVar(&versionCmdFlags.endpoint, "endpoint", "", "The endpoint the service is listening on")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The flags were being set to the wrong versionCmd object, as a result of which, endpoint and connection timeout flags were coming up in docs under chef-automate version command. Corrected this

Copy link
Collaborator

@Dmaddu Dmaddu left a comment

Choose a reason for hiding this comment

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

once made the suggested changes, will review the complete PR again

components/automate-cli/cmd/chef-automate/version.go Outdated Show resolved Hide resolved
Copy link
Contributor

@daveaugustus daveaugustus left a comment

Choose a reason for hiding this comment

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

Tested this application on HA (AWS Deployment), the commands are working fine. The error I hilighted yesterday is fixed.

APPROVING!

components/automate-cli/cmd/chef-automate/version.go Outdated Show resolved Hide resolved
components/automate-cli/cmd/chef-automate/version.go Outdated Show resolved Hide resolved
components/automate-cli/cmd/chef-automate/version.go Outdated Show resolved Hide resolved
components/automate-cli/cmd/chef-automate/version.go Outdated Show resolved Hide resolved
components/automate-cli/cmd/chef-automate/version.go Outdated Show resolved Hide resolved
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Signed-off-by: Shanmugapriya <shramana@progress.com>
Copy link
Collaborator

@Dmaddu Dmaddu left a comment

Choose a reason for hiding this comment

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

https://buildkite.com/chef/chef-automate-main-verify-private/builds/29691
Pipelines are failing because of these changes only. Please address them

Signed-off-by: Shanmugapriya <shramana@progress.com>
@sonarqube-for-infrastructure-prod

SonarQube Quality Gate

Quality Gate failed

Failed condition 0.4% 0.4% Coverage on New Code (is less than 80%)
Failed condition 6.9% 6.9% Duplicated Lines (%) on New Code (is greater than 3%)

See analysis details on SonarQube

@Dmaddu Dmaddu merged commit 60cd4be into main Jun 21, 2023
@Dmaddu Dmaddu deleted the CHEF-727 branch June 21, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add_release_notes documentation Anything related to the Automate docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants