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

Integrated CheckRequiredToolsAreInstalled() function into checkDependenciesForExport() function #2071

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

ShivanshGahlot
Copy link
Collaborator

Describe the changes in this pull request

We had a function CheckRequiredToolsAreInstalled() in the source db interface which we were using to check whether tools like strings, ora2pg, sqlplus were present or not. In this PR I have merged that function into checkDependenciesForExport() which is run along with the guardrails.

Describe if there are any user-facing changes

There is an addition in the command line output for missing dependencies. The overall structure is same. Just that the above mentioned tools will also be shown:
image

How was this pull request tested?

This PR was tested manually. I removed the binaries from their locations and tried to get the output for which binaries are missing. No need to add integration tests.

Does your PR have changes that can cause upgrade issues?

Component Breaking changes?
MetaDB No
Name registry json No
Data File Descriptor Json No
Export Snapshot Status Json No
Import Data State No
Export Status Json No
Data .sql files of tables No
Export and import data queue No
Schema Dump No
AssessmentDB No
Sizing DB No
Migration Assessment Report Json No
Callhome Json No
YugabyteD Tables No
TargetDB Metadata Tables No


missingTools = utils.CheckTools("strings")

case MYSQL:
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor improvement: for mysql, oracle, you can skip the ora2pg check if it's live migration.
(add a todo for now, because as I see this function is called in lots of places - exportschema, exportdata, assess-migration)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a TODO statement and created a ticket:
#2102

Copy link
Collaborator

@makalaaneesh makalaaneesh left a comment

Choose a reason for hiding this comment

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

LGTM

for _, tool := range tools {
execPath, err := exec.LookPath(tool)
if err != nil {
missingTools = append(missingTools, fmt.Sprintf("%s", tool))
Copy link
Collaborator

Choose a reason for hiding this comment

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

missingTools = append(missingTools, tool) ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed it

@ShivanshGahlot ShivanshGahlot merged commit 8ecc7aa into main Dec 19, 2024
42 checks passed
@ShivanshGahlot ShivanshGahlot deleted the shivansh/integrate-check-required-tools branch December 19, 2024 11:18
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