-
Notifications
You must be signed in to change notification settings - Fork 9
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
release v1.3.0 #11
Open
marcellodesales
wants to merge
14
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
release v1.3.0 #11
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just ran the following command: 2to3 -n -W --add-suffix=3 validate_config_files.py A new file was created validate_config_files.py3 and I just replaced the existing with this version. https://docs.python.org/2/library/2to3.html Signed-off-by: Marcello de Sales <[email protected]>
Signed-off-by: Marcello de Sales <[email protected]>
Just minor changes $ 2to3 --output-dir=tests3 -W -n tests WARNING: --write-unchanged-files/-W implies -w. lib2to3.main: Output in 'tests3' will mirror the input directory 'tests' layout. RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored tests/context.py --- tests/context.py (original) +++ tests/context.py (refactored) @@ -43,12 +43,12 @@ message = str(isValid) if isValid else str(isValid) + " ERROR: " + str(validationObject) # The V of successful in green - v = ShellColor.OKGREEN + str(u'\u2714'.encode('UTF-8')) + v = ShellColor.OKGREEN + str('\u2714'.encode('UTF-8')) # The X of failure in red - x = ShellColor.FAIL + str(u'\u2718'.encode('UTF-8')) + x = ShellColor.FAIL + str('\u2718'.encode('UTF-8')) shellStatus = v if isValid else x - print shellStatus + " is " + getRelativeFixturePath(filePath) + " valid? " + message + ShellColor.ENDC + print(shellStatus + " is " + getRelativeFixturePath(filePath) + " valid? " + message + ShellColor.ENDC) class ValidationAssertions: """Validation Assertions for the test cases to validate on the values.""" RefactoringTool: Writing converted tests/context.py to tests3/context.py. RefactoringTool: Refactored tests/test_all_valid_config_validation.py --- tests/test_all_valid_config_validation.py (original) +++ tests/test_all_valid_config_validation.py (refactored) @@ -26,8 +26,8 @@ self.assertTrue(len(self.validationIndex) > 0) def test_all_properties_are_valid(self): - print ShellColor.WARNING + "All config files are valid" + ShellColor.ENDC - for filePath, validationObject in self.validationIndex.iteritems(): + print(ShellColor.WARNING + "All config files are valid" + ShellColor.ENDC) + for filePath, validationObject in self.validationIndex.items(): printFileValidationStatus(filePath, validationObject) # Verify if the directory is in the file path RefactoringTool: Writing converted tests/test_all_valid_config_validation.py to tests3/test_all_valid_config_validation.py. RefactoringTool: Refactored tests/test_invalid_matrix_json_validation.py --- tests/test_invalid_matrix_json_validation.py (original) +++ tests/test_invalid_matrix_json_validation.py (refactored) @@ -26,8 +26,8 @@ self.assertTrue(len(self.validationIndex) > 0) def test_all_matrix_json_files_are_invalid(self): - print ShellColor.WARNING + "The android matrix file is invalid" + ShellColor.ENDC - for filePath, validationObject in self.validationIndex.iteritems(): + print(ShellColor.WARNING + "The android matrix file is invalid" + ShellColor.ENDC) + for filePath, validationObject in self.validationIndex.items(): isValid = isConfigValid(validationObject) printFileValidationStatus(filePath, validationObject) RefactoringTool: Writing converted tests/test_invalid_matrix_json_validation.py to tests3/test_invalid_matrix_json_validation.py. RefactoringTool: Refactored tests/test_invalid_properties_validation.py --- tests/test_invalid_properties_validation.py (original) +++ tests/test_invalid_properties_validation.py (refactored) @@ -26,8 +26,8 @@ self.assertTrue(len(self.validationIndex) > 0) def test_some_yaml_yml_files_are_invalid(self): - print ShellColor.WARNING + "Properties files are invalid without associated values" + ShellColor.ENDC - for filePath, validationObject in self.validationIndex.iteritems(): + print(ShellColor.WARNING + "Properties files are invalid without associated values" + ShellColor.ENDC) + for filePath, validationObject in self.validationIndex.items(): isValid = isConfigValid(validationObject) printFileValidationStatus(filePath, validationObject) RefactoringTool: Writing converted tests/test_invalid_properties_validation.py to tests3/test_invalid_properties_validation.py. RefactoringTool: Refactored tests/test_invalid_yaml_yml_duplicate_keys.py --- tests/test_invalid_yaml_yml_duplicate_keys.py (original) +++ tests/test_invalid_yaml_yml_duplicate_keys.py (refactored) @@ -26,8 +26,8 @@ self.assertTrue(len(self.validationIndex) > 0) def test_some_yaml_yml_files_are_invalid(self): - print ShellColor.WARNING + "Some Yaml Single documents are invalid" + ShellColor.ENDC - for filePath, validationObject in self.validationIndex.iteritems(): + print(ShellColor.WARNING + "Some Yaml Single documents are invalid" + ShellColor.ENDC) + for filePath, validationObject in self.validationIndex.items(): isValid = isConfigValid(validationObject) printFileValidationStatus(filePath, validationObject) RefactoringTool: Writing converted tests/test_invalid_yaml_yml_duplicate_keys.py to tests3/test_invalid_yaml_yml_duplicate_keys.py. RefactoringTool: Refactored tests/test_invalid_yaml_yml_multi_document_validation.py --- tests/test_invalid_yaml_yml_multi_document_validation.py (original) +++ tests/test_invalid_yaml_yml_multi_document_validation.py (refactored) @@ -26,8 +26,8 @@ self.assertTrue(len(self.validationIndex) > 0) def test_some_yaml_yml_files_are_invalid(self): - print ShellColor.WARNING + "Some Yaml Multi documents are invalid" + ShellColor.ENDC - for filePath, validationObject in self.validationIndex.iteritems(): + print(ShellColor.WARNING + "Some Yaml Multi documents are invalid" + ShellColor.ENDC) + for filePath, validationObject in self.validationIndex.items(): isValid = isConfigValid(validationObject) printFileValidationStatus(filePath, validationObject) RefactoringTool: Writing converted tests/test_invalid_yaml_yml_multi_document_validation.py to tests3/test_invalid_yaml_yml_multi_document_validation.py. RefactoringTool: Refactored tests/test_invalid_yaml_yml_single_document_validation.py --- tests/test_invalid_yaml_yml_single_document_validation.py (original) +++ tests/test_invalid_yaml_yml_single_document_validation.py (refactored) @@ -26,8 +26,8 @@ self.assertTrue(len(self.validationIndex) > 0) def test_some_yaml_yml_files_are_invalid(self): - print ShellColor.WARNING + "Some Yaml Single documents are invalid" + ShellColor.ENDC - for filePath, validationObject in self.validationIndex.iteritems(): + print(ShellColor.WARNING + "Some Yaml Single documents are invalid" + ShellColor.ENDC) + for filePath, validationObject in self.validationIndex.items(): isValid = isConfigValid(validationObject) printFileValidationStatus(filePath, validationObject) RefactoringTool: Writing converted tests/test_invalid_yaml_yml_single_document_validation.py to tests3/test_invalid_yaml_yml_single_document_validation.py. RefactoringTool: Files that were modified: RefactoringTool: tests/context.py RefactoringTool: tests/test_all_valid_config_validation.py RefactoringTool: tests/test_invalid_matrix_json_validation.py RefactoringTool: tests/test_invalid_properties_validation.py RefactoringTool: tests/test_invalid_yaml_yml_duplicate_keys.py RefactoringTool: tests/test_invalid_yaml_yml_multi_document_validation.py RefactoringTool: tests/test_invalid_yaml_yml_single_document_validation.py Signed-off-by: Marcello de Sales <[email protected]>
Signed-off-by: Marcello de Sales <[email protected]>
…ng lint Getting the following error: /build/validate_config_files.py:181: ResourceWarning: unclosed file <_io.TextIOWrapper name='/build/tests/fixtures/all-valid-config/publisher-onboard_preprod.yml' mode='r' encoding='UTF-8'> lintError = list(linter.run(open(filePath), yamlLintConfig)); Signed-off-by: Marcello de Sales <[email protected]>
…m-wide https://stackoverflow.com/questions/879173/how-to-ignore-deprecation-warnings-in-python/55947748#55947748 test_all_properties_are_valid (test_all_valid_config_validation.AllSuccessfulTests) ... /usr/lib/python3.6/site-packages/glob2/fnmatch.py:80: DeprecationWarning: Flags not at the start of the expression '(.*)\\Z(?ms)' return re.compile(res, flags).match /usr/lib/python3.6/site-packages/glob2/fnmatch.py:80: DeprecationWarning: Flags not at the start of the expression '(.*)\\.json\\Z(?ms)' return re.compile(res, flags).match /usr/lib/python3.6/site-packages/glob2/fnmatch.py:80: DeprecationWarning: Flags not at the start of the expression '(.*)\\.yaml\\Z(?ms)' return re.compile(res, flags).match /usr/lib/python3.6/site-packages/glob2/fnmatch.py:80: DeprecationWarning: Flags not at the start of the expression '(.*)\\.yml\\Z(?ms)' return re.compile(res, flags).match /usr/lib/python3.6/site-packages/glob2/fnmatch.py:80: DeprecationWarning: Flags not at the start of the expression '(.*)\\.properties\\Z(?' (truncated) return re.compile(res, flags).match ok Signed-off-by: Marcello de Sales <[email protected]>
Fixed by using the decode UTF-8 method https://stackoverflow.com/questions/21689365/python-3-typeerror-must-be-str-not-bytes-with-sys-stdout-write/21689447#21689447 remote: ##################################################### remote: #### Intuit Spring Cloud Config Validator 1.2.0 ##### remote: ##################################################### remote: Validating new branch... remote: Processing commit=5f2acca1293550dc4ecc7aab26e77c52d74f15aa ref=refs/heads/master remote: Traceback (most recent call last): remote: File "hooks/pre-receive", line 354, in <module> remote: (executationDirPath, validationIndex) = ShellExecution.run() remote: File "hooks/pre-receive", line 326, in run remote: currentDirPath = dirPath if dirPath else ExecutionContext.getCurrentDirPath() remote: File "hooks/pre-receive", line 83, in getCurrentDirPath remote: currentDirPath = Validator.processPreReceivehookFilesInGithub(base, commit) remote: File "hooks/pre-receive", line 243, in processPreReceivehookFilesInGithub remote: content = GitRepo.openCommitFileContent(fileName, head) remote: File "hooks/pre-receive", line 129, in openCommitFileContent remote: (results, code) = GitRepo.git(('git', 'show', commit + ":" + fileName)) remote: TypeError: must be str, not bytes To 192.168.86.249:test.git Signed-off-by: Marcello de Sales <[email protected]>
Fixed with the decode method described at https://stackoverflow.com/questions/21689365/python-3-typeerror-must-be-str-not-bytes-with-sys-stdout-write/21689447#21689447 * Broken issue: GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i /Users/mdesales/dev/github/public/intuit/intuit-spring-cloud-config-validator/.id_rsa_from_github_simulator_server" git push test new-branch -f Warning: Permanently added '[192.168.86.249]:52311' (ECDSA) to the list of known hosts. Enumerating objects: 37, done. Counting objects: 100% (37/37), done. Delta compression using up to 8 threads Compressing objects: 100% (12/12), done. Writing objects: 100% (35/35), 1.93 KiB | 659.00 KiB/s, done. Total 35 (delta 8), reused 0 (delta 0) remote: ##################################################### remote: #### Intuit Spring Cloud Config Validator 1.3.0 ##### remote: ##################################################### remote: Validating new branch... remote: Processing commit=a34a90b2bfcd2018b746e8ee78e51bf393e6dbc1 ref=refs/heads/new-branch remote: Traceback (most recent call last): remote: File "hooks/pre-receive", line 354, in <module> remote: (executationDirPath, validationIndex) = ShellExecution.run() remote: File "hooks/pre-receive", line 326, in run remote: currentDirPath = dirPath if dirPath else ExecutionContext.getCurrentDirPath() remote: File "hooks/pre-receive", line 83, in getCurrentDirPath remote: currentDirPath = Validator.processPreReceivehookFilesInGithub(base, commit) remote: File "hooks/pre-receive", line 263, in processPreReceivehookFilesInGithub remote: filePath = Validator.saveFileContent(fileName, content, contextDir) remote: File "hooks/pre-receive", line 202, in saveFileContent remote: text_file.write(content) remote: TypeError: write() argument must be str, not bytes Signed-off-by: Marcello de Sales <[email protected]>
Signed-off-by: Marcello de Sales <[email protected]>
Signed-off-by: Marcello de Sales <[email protected]>
For packaging for Github Enterprise, users can now package from the current source or package from the given docker image version specified in the .env file. Signed-off-by: Marcello de Sales <[email protected]>
Signed-off-by: Marcello de Sales <[email protected]>
Migrate to python 3 + packaging to Github Enterprise
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features
package.sh
: users can now package an existing version or a version from the source-code in 1 single command