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

Fix Generate Docs for new Integration in Existing Pack #4162

Merged
merged 5 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/4162.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixed an issue where **generate-docs** command didn't work on newly-created integrations in existing Packs.
type: fix
pr_number: 4162
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,12 @@ def _get_resource_path_from_source_control(
# so there's no need to get the file from remote.
# We therefore set the output path to the relative path from
# the content path of the resource.
if self.is_ui_contribution or not remote:
if self.is_ui_contribution:
relative_resource_path = os.path.join(
INTEGRATIONS_DIR, self.integration_name, resource_path.name
)
path = list(get_content_path().glob(f"**/{relative_resource_path}"))[0]
elif remote:

else:
if not resource_path.is_absolute():
resource_path = resource_path.absolute()

Expand All @@ -158,8 +157,8 @@ def _get_resource_path_from_source_control(
KeyError,
IndexError,
) as e:
msg = f"{e.__class__.__name__}: Could not find file '{str(resource_path)}' in {'remote' if remote else 'local'}. Please specify the full path to the integration YAML file, e.g. `demisto-sdk generate-docs -i $(realpath {resource_path})`"
logger.error(msg)
msg = f"{e.__class__.__name__}: Could not find file '{resource_path}' in {'remote' if remote else 'local'}."
logger.debug(msg)
self.update_errors.append(msg)
path = None
except InvalidGitRepositoryError as err:
Expand Down