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

Modify get server API for migration status and migration type both #6644

Closed
wants to merge 138 commits into from

Conversation

YashviJain01
Copy link
Collaborator

@YashviJain01 YashviJain01 commented Jan 31, 2022

🔩 Description: What code changed, and why?

Added Migration id, migration type and migration status for active migration in get server API to show the status on Server page itself.

⛓️ Related Resources

https://chefio.atlassian.net/jira/software/c/projects/STALWART/boards/361?modal=detail&selectedIssue=STALWART-34

👍 Definition of Done

Migration id, migration type and migration status can be fetched in the server page now. If a server has a active migration going on, the migration id and migration type column will be fetched

👟 How to Build and Test the Change

rebuild components/automate-gateway/
rebuild components/infra-proxy-service

Ensure Chef Infra Server is running. If it is not start it with start_chef_server
Add the chef-server test environment credentials and extract the SERVER IDs

Request:
curl --location --request GET 'https://a2-dev.test/api/v0/infra/servers/${server_id}' \--header 'api-token: ${get_admin_token}

Response:

    "server": {
        "id": "test",
        "name": "test",
        "fqdn": "fqdn",
        "ip_address": "",
        "orgs_count": 0,
        "migration_id": "id",
        "migration_type": "tyoe",
        "migration_status": "status"
    }
}

✅ 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

sonali523 and others added 30 commits January 27, 2022 12:34
* Script added for table 'users'

Signed-off-by: root <swale@msystechnologies.com>

* updated down script

Signed-off-by: root <swale@msystechnologies.com>

* updated up script

Signed-off-by: root <swale@msystechnologies.com>

* updated up script

Signed-off-by: root <swale@msystechnologies.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
…hen doing builds (#5741)

Signed-off-by: Rick Marry <rmarry@chef.io>
Signed-off-by: root <swale@msystechnologies.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
* Storage functions added for users table

Signed-off-by: root <swale@msystechnologies.com>

* Updated with review comments

Signed-off-by: root <swale@msystechnologies.com>
* converted server modal into slider

Signed-off-by: chaitali-mane <cmane@progress.com>

* Updated test cases

Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
* converted server modal into slider

Signed-off-by: chaitali-mane <cmane@progress.com>

* Updated test cases

Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
* added some changes for the create server slider

Signed-off-by: Vinay Sharma <vsharma@chef.io>

* added some minor changes

Signed-off-by: Vinay Sharma <vsharma@chef.io>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: root <swale@msystechnologies.com>
* Added Users tab UI

Signed-off-by: chaitali-mane <cmane@progress.com>

* Added enitites api integration

Signed-off-by: chaitali-mane <cmane@progress.com>

* minor changes

Signed-off-by: chaitali-mane <cmane@progress.com>

* Updated minor change

Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: Himanshi Chhabra <hchhabra@progress.com>
* Shell script added to add the sample infra server users

Signed-off-by: root <swale@msystechnologies.com>

* Minor changes added

Signed-off-by: root <swale@msystechnologies.com>
Signed-off-by: Kallol Roy <karoy@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Abdul-Az <aazeez@progress.com>
chaitali-mane and others added 11 commits January 27, 2022 12:34
* Updated cypress tests for web ui key

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Key in uppercase

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Update for minor

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed unused lines

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed error unit tests

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed iam lint error

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Adding Cypress env variable for WebUI key

Signed-off-by: Kallol Roy <karoy@progress.com>

* Updated variable

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed replace

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Adding variable

Signed-off-by: Chaitali Mane <cmane@progress.com>

* minor change

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed hard coded values

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Removed hard coded values

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Updated variables

Signed-off-by: Chaitali Mane <cmane@progress.com>

Co-authored-by: Kallol Roy <karoy@progress.com>
Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>
* updated docs

Signed-off-by: Abdul-Az <aazeez@progress.com>

* cypress error fix

Signed-off-by: Abdul-Az <aazeez@progress.com>

* lint fixes

Signed-off-by: Abdul-Az <aazeez@progress.com>

* updated docs

Signed-off-by: Abdul-Az <aazeez@progress.com>

* cypress error fix

Signed-off-by: Abdul-Az <aazeez@progress.com>

* Added button as per new design

Signed-off-by: Chaitali Mane <cmane@progress.com>

* update change

Signed-off-by: Chaitali Mane <cmane@progress.com>

Co-authored-by: Abdul-Az <aazeez@progress.com>
Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>
* Get organisation API changes added

Signed-off-by: sonali wale <sonali.wale@progress.com>

* minor changes added

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Remove command to create an orgs

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Client Mock changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Storage function for all the phases of migration

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Minor changes added

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Incorporated review comments

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Minor changes added

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Changes for review comments

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Comments removed

Signed-off-by: sonali wale <sonali.wale@progress.com>

Co-authored-by: Yashvi Jain <Yashvi.jain@progress.com>
Signed-off-by: sonali wale <sonali.wale@progress.com>
* resolving conflicts and rebasing it

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Removing the loggers

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Query changes for lastes migration status

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* changing the response varibale

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>
* added changes for infra proxy audit log

* added reflect codes

Signed-off-by: Kallol Roy <karoy@progress.com>

* added changes for the audit logs for infra

Signed-off-by: Vinay Sharma <vsharma@chef.io>

* removed commented code

Signed-off-by: Vinay Sharma <vsharma@chef.io>

* added some minor changes

Signed-off-by: Vinay Sharma <vsharma@chef.io>

Co-authored-by: Kallol Roy <karoy@progress.com>
…ip file (#6612)

* Changes for stream api for upload

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* added some changes for the protofile

Signed-off-by: Vinay Sharma <vsharma@chef.io>

* added function changes

* added changes for the proto

* added changes to devide the chunks in bytes

* added changes for the validation

Signed-off-by: Vinay Sharma <vsharma@chef.io>

* adding status in database

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* adding the request for server id and filename

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Adding  loggers and saving the failed migration phase

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* optimising the code

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Changes for content-type

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* added changes for the validation

Signed-off-by: Vinay Sharma <vsharma@chef.io>

* Upload to the hab svc data folder

Signed-off-by: Kallol Roy <karoy@progress.com>

* Enhance log and modify migration phases

Signed-off-by: Kallol Roy <karoy@progress.com>

* Granularize the migration stages

Signed-off-by: Kallol Roy <karoy@progress.com>

* Granularize the migration stages

Signed-off-by: Kallol Roy <karoy@progress.com>

Co-authored-by: Vinay Sharma <vsharma@chef.io>
Co-authored-by: Kallol Roy <karoy@progress.com>
* Get migrations status API added

Signed-off-by: sonali wale <sonali.wale@progress.com>

* Added minor changes

Signed-off-by: sonali wale <sonali.wale@progress.com>
Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>
@netlify
Copy link

netlify bot commented Jan 31, 2022

👷 Deploy Preview for chef-automate processing.

🔨 Explore the source changes: 12f6b48

🔍 Inspect the deploy log: https://app.netlify.com/sites/chef-automate/deploys/61f797e5c6579d00083cdc1d

@YashviJain01 YashviJain01 self-assigned this Jan 31, 2022
@YashviJain01 YashviJain01 requested review from vinay033, kalroy and sonali523 and removed request for vinay033 and kalroy January 31, 2022 08:04
@YashviJain01 YashviJain01 added automate-infra-proxy-api using for automate infra proxy backend api's infra-user-mgnt Team: Stalwart Migrate Chef Manage, UI bugs, UX improvements, CVE Issues labels Jan 31, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jan 31, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 20 Code Smells

5.6% 5.6% Coverage
1.1% 1.1% Duplication

@YashviJain01
Copy link
Collaborator Author

Creating a pull request for feature branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automate-infra-proxy-api using for automate infra proxy backend api's infra-user-mgnt Team: Stalwart Migrate Chef Manage, UI bugs, UX improvements, CVE Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants