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

Convert windows line ending and previous PR #276

Merged
merged 19 commits into from
Jun 10, 2024
Merged

Conversation

pem70
Copy link
Collaborator

@pem70 pem70 commented Jun 4, 2024

What It Does
Fixes [#104]
Address issues [#264] and [#265] by refactoring classes and tests

How to Test

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: pem70 <[email protected]>
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 93.06931% with 63 lines in your changes missing coverage. Please review.

Project coverage is 89.28%. Comparing base (5816aab) to head (95ac994).
Report is 230 commits behind head on main.

Files with missing lines Patch % Lines
.../zos_files/zowe/zos_files_for_zowe_sdk/datasets.py 88.42% 25 Missing ⚠️
src/zos_files/zowe/zos_files_for_zowe_sdk/uss.py 66.10% 20 Missing ⚠️
src/zos_files/zowe/zos_files_for_zowe_sdk/files.py 78.26% 10 Missing ⚠️
...s_files/zowe/zos_files_for_zowe_sdk/file_system.py 90.00% 5 Missing ⚠️
tests/unit/core/test_config.py 96.07% 2 Missing ⚠️
src/core/zowe/core_for_zowe_sdk/profile_manager.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
+ Coverage   86.21%   89.28%   +3.06%     
==========================================
  Files          35       53      +18     
  Lines        2292     2519     +227     
==========================================
+ Hits         1976     2249     +273     
+ Misses        316      270      -46     
Flag Coverage Δ
unittests 89.28% <93.06%> (+3.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pem70 pem70 requested review from t1m0thyj, zFernand0 and traeok and removed request for zFernand0 June 4, 2024 15:37
@pem70 pem70 marked this pull request as ready for review June 5, 2024 14:47
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

Looks pretty good, thanks for restructuring code and tests @pem70! Left a few comments

CHANGELOG.md Show resolved Hide resolved
src/core/zowe/core_for_zowe_sdk/logger.py Outdated Show resolved Hide resolved
src/zos_files/zowe/zos_files_for_zowe_sdk/datasets.py Outdated Show resolved Hide resolved
src/zos_files/zowe/zos_files_for_zowe_sdk/file_system.py Outdated Show resolved Hide resolved
src/zos_files/zowe/zos_files_for_zowe_sdk/uss.py Outdated Show resolved Hide resolved
tests/unit/files/datasets/test_delete.py Outdated Show resolved Hide resolved
tests/unit/files/datasets/test_rename.py Outdated Show resolved Hide resolved
tests/unit/files/datasets/test_rename.py Outdated Show resolved Hide resolved
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

Most comments from #274 and #275 seem to have been addressed in this PR.
Thank you! 🥳

CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
tests/unit/core/test_request_handler.py Show resolved Hide resolved
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

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

Looking good so far! 🥳
I'll approve once all PR comments are resolved.

Also, I noticed that you've been trying to keep the two PRs in sync (e.g. logger class changes or test-delete function names). To avoid extra work, you can base your other PR (#277) to this PR's target branch (convert_windows_line_ending)

src/core/zowe/core_for_zowe_sdk/logger.py Show resolved Hide resolved
logger.error(f"Unknown type is found in schema_json, exc")
raise jsonschema.exceptions.UnknownType(f"Unknown type is found in schema_json, exc")
logger.error(f"Unknown type is found in schema_json, {exc}")
raise jsonschema.exceptions.UnknownType(f"Unknown type is found in schema_json, {exc}")
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

Not sure if we should do a quick search across the board to make sure that we are interpolating/inserting the value of the error instead of the literal string of the variable name

from zowe.zos_files_for_zowe_sdk.constants import FileType
from .datasets import Datasets
from .uss import USSFiles
from .file_system import FileSystems

_ZOWE_FILES_DEFAULT_ENCODING = "utf-8"
Copy link
Member

Choose a reason for hiding this comment

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

I know all functions in this class are deprecated, but curious if we should also move this into a constansts.py file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure as I hardly think these imports would be used again in another file.

Comment on lines +47 to +54
def list(self, path):
"""Retrieve a list of USS files based on a given pattern.

Returns
-------
json
A JSON with a list of dataset names matching the given pattern
"""
Copy link
Member

Choose a reason for hiding this comment

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

I know it may be a little redundant, and Timothy mentioned this offline not long ago...
Also, we don't have to do this as part of this PR.

Q: Should we make sure that the docs are complete and accurate?

  • For example, this is missing the parameters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we definitely need to standardize the docs, but maybe not in this PR

Copy link
Member

Choose a reason for hiding this comment

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

Created #279 to track this

pem70 and others added 3 commits June 5, 2024 15:31
Co-authored-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Peizhao Mei <[email protected]>
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @pem70 for the fix and restructuring! I left a couple comments, but I don't have anything that must be addressed.

tests/unit/files/datasets/test_list.py Show resolved Hide resolved
src/zos_files/zowe/zos_files_for_zowe_sdk/uss.py Outdated Show resolved Hide resolved
@pem70
Copy link
Collaborator Author

pem70 commented Jun 7, 2024

Revert changes from previous commit as it would break testing environments.

@pem70 pem70 force-pushed the convert_windows_line_ending branch from 34a3582 to 736e714 Compare June 7, 2024 14:51
Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @pem70! Will approve after conflicts have been resolved

Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @pem70!

@t1m0thyj t1m0thyj dismissed zFernand0’s stale review June 10, 2024 18:56

Changes were addressed

@t1m0thyj t1m0thyj merged commit cdf6265 into main Jun 10, 2024
21 checks passed
@t1m0thyj t1m0thyj deleted the convert_windows_line_ending branch June 10, 2024 18:57
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.

4 participants