Skip to content

Commit

Permalink
Add README to PR update scope (#79)
Browse files Browse the repository at this point in the history
* Added README to PR update scope

* Added README to PR update scope
  • Loading branch information
goruha authored Dec 16, 2024
1 parent 6d7d813 commit 7c99e5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/component_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ def __does_component_needs_to_be_updated(self, original_component: AtmosComponen
if updated_file.endswith(COMPONENT_YAML):
continue

if updated_file.endswith(README_EXTENTION):
continue

# skip folders
if not os.path.isfile(updated_file):
continue
Expand All @@ -279,15 +276,17 @@ def __does_component_needs_to_be_updated(self, original_component: AtmosComponen
files_to_update.append(relative_path)
if not os.path.isfile(original_file):
logging.info(f"New file: {relative_path}")
needs_update = True
# Adding *.md file does not require component update, but still should be included into a PR
needs_update = needs_update or not relative_path.endswith(README_EXTENTION)
continue

if io.calc_file_md5_hash(original_file) != io.calc_file_md5_hash(updated_file):
logging.info(f"File changed: {relative_path}")
if num_diffs < MAX_NUMBER_OF_DIFF_TO_SHOW:
logging.info(f"diff: {self.__tools_manager.diff(original_file, updated_file)}")
num_diffs += 1
needs_update = True
# Adding *.md file does not require component update, but still should be included into a PR
needs_update = needs_update or not relative_path.endswith(README_EXTENTION)

for original_file in original_files:
relative_path = os.path.relpath(original_file, original_component.infra_repo_dir)
Expand All @@ -297,7 +296,8 @@ def __does_component_needs_to_be_updated(self, original_component: AtmosComponen
if os.path.isfile(source_file) and not os.path.isfile(updated_file):
logging.info(f"Remove file: {relative_path}")
files_to_remove.append(relative_path)
needs_update = True
# Adding *.md file does not require component update, but still should be included into a PR
needs_update = needs_update or not relative_path.endswith(README_EXTENTION)
continue

if needs_update:
Expand Down
2 changes: 1 addition & 1 deletion src/github_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def open_pr(self,
old_source_name=old_source_name,
old_source_link=old_source_link,
new_source_name=new_source_name,
new_source_link=old_source_link,
new_source_link=new_source_link,
old_version=original_component.version,
new_version=updated_component.version,
old_version_link=original_component_version_link,
Expand Down

0 comments on commit 7c99e5d

Please sign in to comment.