Repository navigation
fix(codecharta): merge without a terminal, apply directory excludes to DependaCharta, optionally limit git history - #146
Merged
Conversation
…o DependaCharta, optionally limit git history - ccsh merge gets -f: when the input maps share no top-level folder it asks for confirmation in a terminal session, which crashes on CI. - extra_excludes entries that name an existing directory are hidden from DependaCharta by mounting an empty directory over them; the pinned image has no exclude option, so a large vendored tree was analyzed file by file and could exceed the 15-minute job timeout. - New git_log_since input limits the history the git metrics are built from, for repos whose older history the git log parser cannot follow.
This file contains hidden or 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
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.
Summary
Three fixes to
universal-codecharta-snapshot, found while adopting the CodeCharta workflow in repos that weren't greenfield. One new optional input; existing callers keep the current behaviour.ccsh mergeasks for confirmation in a terminal session (MergeFilter.continueIfIncompatibleProjects). The runner has no terminal, so the run dies withIllegalStateException: Unable to create a system terminal.-fonly skips that check.extra_excludesdidn't apply to DependaCharta. The pinned fork (fork-v0.2.1) has no exclude option, so a vendored tree was analysed file by file. In an Android app with a ~2,900-file engine export, DependaCharta took 13 of the job's 15 minutes and the run was cancelled. An entry that names an existing directory is now hidden by mounting an empty directory over it. Regex and file patterns still apply only to ccsh and tokei. It works with any DependaCharta image.git_log_sincebuilds the same logrepo-scangenerates, limited with--since, and feeds it tolog-scan.Evidence
Run locally with
codecharta.sh snapshotandcodecharta/codecharta-analysis:1.143.0:git_log_since: <date after the replace>extra_excludes: <engine export dir>DependaCharta: excluding directory …; 1,264 files, no nodes from the excluded tree; final map writtengit_log_since: not-a-dategit log --sinceis lenient)actionlintandshellcheck -S warningare clean. The excludes path was also run under bash 3.2: empty arrays are expanded safely withset -u.Merge Danger
Door: two-way
Blast Radius: CodeCharta consumers
-f: changes nothing when the maps overlap, which is the normal case.extra_excludeswith directory paths will now also have those directories left out of the DependaCharta graph. That's the documented intent of the input, but their graphs will lose those nodes.git_log_since: has no effect when unset.Needs a release (
bump-action-refs.sh) before consumers can usegit_log_since.