Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .changelog/5159.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelog/5166.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .changelog/5169.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Changelog
## 1.38.16 (2025-12-28)
### Feature
* Adding support for handling private repositories. [#5159](https://github.com/demisto/demisto-sdk/pull/5159)

### Fix
* Fixed an issue where the ***format*** command attempted to format list data files when it should only format list metadata files. [#5166](https://github.com/demisto/demisto-sdk/pull/5166)

### Internal
* Ignore gr110 when validating all in the github action. [#5169](https://github.com/demisto/demisto-sdk/pull/5169)


## 1.38.15 (2025-12-16)
### Feature
* Added the `provider` field to the integration schema. [#5155](https://github.com/demisto/demisto-sdk/pull/5155)
Expand Down
28 changes: 22 additions & 6 deletions demisto_sdk/commands/content_graph/commands/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
def should_update_graph(
content_graph_interface: ContentGraphInterface,
use_git: bool,
git_util: GitUtil,
git_util: Optional[GitUtil],
imported_path: Optional[Path] = None,
packs_to_update: Optional[List[str]] = None,
):
if content_graph_interface.commit:
if content_graph_interface.commit and git_util:
try:
changed_pack_ids = git_util.get_all_changed_pack_ids(
content_graph_interface.commit
Expand Down Expand Up @@ -97,14 +97,25 @@ def update_content_graph(
logger.info("A path to import the graph from was not provided, using git")
use_git = True

git_util = GitUtil()
is_external_repo = is_external_repository()
try:
git_util = GitUtil()
is_external_repo = is_external_repository()
except Exception as e:
logger.debug(
f"Could not initialize GitUtil: {e}. Assuming external repo and skipping git operations."
)
# If git is not available, we can't use git-based updates
# This can happen in CI/CD environments where the working directory is not a git repo
use_git = False
git_util = None # type: ignore[assignment]
is_external_repo = True

if is_external_repo:
packs_to_update = get_all_repo_pack_ids()
packs_to_update = list(packs_to_update) if packs_to_update else []
builder = ContentGraphBuilder(content_graph_interface)
if not should_update_graph(
# If git_util is None, we can't check if we should update, so assume we should not
if git_util and not should_update_graph(
content_graph_interface, use_git, git_util, imported_path, packs_to_update
):
logger.info(
Expand Down Expand Up @@ -145,7 +156,12 @@ def update_content_graph(
content_graph_interface, marketplace, dependencies, output_path
)
return
if use_git and (commit := content_graph_interface.commit) and not is_external_repo:
if (
use_git
and git_util
and (commit := content_graph_interface.commit)
and not is_external_repo
):
try:
git_util.get_all_changed_pack_ids(commit)
except Exception as e:
Expand Down
4 changes: 3 additions & 1 deletion demisto_sdk/commands/validate/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,9 @@ def git_paths_to_basecontent_set(
old_path = file_path
if isinstance(file_path, tuple):
file_path, old_path = file_path
obj = BaseContent.from_path(file_path, raise_on_exception=True)
obj = BaseContent.from_path(
file_path, git_sha=None, raise_on_exception=True
)
if obj:
obj.git_sha = current_git_sha
obj.git_status = git_status
Expand Down
11 changes: 7 additions & 4 deletions demisto_sdk/commands/validate/validators/base_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,13 @@ def graph(self) -> ContentGraphInterface:
if not self.graph_interface:
logger.info("Graph validations were selected, will init graph")
BaseValidator.graph_interface = ContentGraphInterface()
update_content_graph(
BaseValidator.graph_interface,
use_git=True,
)
# Only update the graph if it's not already alive/initialized
# This prevents re-running git operations that may fail in CI/CD environments
if not BaseValidator.graph_interface.is_alive():
update_content_graph(
BaseValidator.graph_interface,
use_git=True,
)
return self.graph_interface

def __dir__(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = "tests/.*|demisto_sdk/commands/init/templates/.*"

[tool.poetry]
name = "demisto-sdk"
version = "1.38.15"
version = "1.38.16"
description = "\"A Python library for the Demisto SDK\""
authors = ["Demisto"]
license = "MIT"
Expand Down