-
Notifications
You must be signed in to change notification settings - Fork 80
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
NC | S3 internal APIs gaps | Add versions CLI command | S3 internal API refactoring #8800
base: master
Are you sure you want to change the base?
Conversation
ff1877a
to
cb95c81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I added minor comments and questions
The `versions` command is used to print the status of the rpm_source_code_versions, host_running_service_versions and config_dir_version. | ||
- rpm_source_code_versions consists of the package_version and the config_fs version. | ||
- host_running_service_versions consists of the running service package_version and config_fs version. | ||
- config_dir_version is the current config_dir_version registered in system.json. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add the var name style for easier reading, for example:
The `versions` command is used to print the status of the rpm_source_code_versions, host_running_service_versions and config_dir_version. | |
- rpm_source_code_versions consists of the package_version and the config_fs version. | |
- host_running_service_versions consists of the running service package_version and config_fs version. | |
- config_dir_version is the current config_dir_version registered in system.json. | |
The `versions` command is used to print the status of the `rpm_source_code_versions`, `host_running_service_versions`, and `config_dir_version`. | |
- `rpm_source_code_versions` consists of the `package_version` and the `config_fs` version. | |
- `host_running_service_versions` consists of the running service `package_version` and `config_fs` version. | |
- `config_dir_version` is the current `config_dir_version` registered in `system.json`. |
@@ -60,6 +61,13 @@ const SERVICES_TYPES_ENUM = Object.freeze({ | |||
METRICS: 'METRICS' | |||
}); | |||
|
|||
const INTERNAL_APIS_OBJ = Object.freeze({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment about this object?
It is only used in NC deployment, and this file is mutual for all deployments.
/** | ||
* get_version_api_response runs a GET request to the given api and returns the response | ||
* @param {string} api | ||
* @returns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing parameter?
@@ -0,0 +1,143 @@ | |||
/* Copyright (C) 2016 NooBaa */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can update the year
/* Copyright (C) 2016 NooBaa */ | |
/* Copyright (C) 2025 NooBaa */ |
package_version: pkg.version, | ||
config_fs_version: CONFIG_DIR_VERSION | ||
}, | ||
expected_config_dir_version: 'unknown' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help others understand the flow better - in this case, I would add a comment that we see the 'unknown' because there is no system.json file, and in the other cases I would just point to the reason (I understand that it is written in the test title, but I think it can help).
|
||
#### Usage | ||
```sh | ||
noobaa-cli versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to make sure - that there will be no additional actions (we could noobaa-cli versions status
, but choose this way). Could you share your thoughts on this decision?
@romayalon if you can attach or add in the manual testing the expected result I think it can be easier to understand parts of the cases. |
config_dir_version: system_json?.config_directory.config_dir_version || 'unknown' | ||
}; | ||
|
||
const response = { code: ManageCLIResponse.VersionsStatus, detail: versions }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romayalon
suggestion: will it help if the rpm and host versions are different and the version status returns an error message mentioning that conflict?
Signed-off-by: Romy <[email protected]>
07a7878
to
a165994
Compare
Explain the changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
sudo jest --testRegex=jest_tests/test_cli_versions
Service is up -
a. Tab 1 - start noobaa service -
sudo node noobaa-core/src/cmd/nsfs.js --debug
b. Tab 2 - run noobaa-cli versions command -
noobaa-cli versions
Service is down -
a. Tab 1 - start noobaa service -
sudo node noobaa-core/src/cmd/nsfs.js --debug
, stop noobaa service - Ctrl + Cb. Tab 1 - run noobaa-cli versions command -
noobaa-cli versions
system.json was never created -
a. Tab 1 - run noobaa-cli versions command -
noobaa-cli versions