Skip to content

Incremental SAST - #8

Open
endor-lmoreno wants to merge 12 commits into
placeholderfrom
incremental_sast_update
Open

Incremental SAST#8
endor-lmoreno wants to merge 12 commits into
placeholderfrom
incremental_sast_update

Conversation

@endor-lmoreno

Copy link
Copy Markdown

No description provided.

@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch 2 times, most recently from e25b17d to 9625afa Compare February 16, 2026 10:01
Update the endorlabs GitHub Actions workflow to perform a shallow checkout. Adds `fetch-depth: 1` and `fetch-tags: false` to the actions/checkout@v3 step (with explanatory comments) so only the current commit and PR branch are fetched, reducing checkout time and ensuring the base branch and tags aren't available locally.
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch 2 times, most recently from 8ff2b5b to e7a35d1 Compare February 16, 2026 10:33
Update .github/workflows/endorlabs.yml to comment out the shallow-checkout options and add a step that deletes local/remotes refs and any tag for the 'incremental_sast' branch. This explicitly removes the base branch reference (if present) during the job to simulate a missing base branch for tooling that relies on its absence; deletion commands are no-ops if refs/tags don't exist.
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch from e7a35d1 to 64ba172 Compare February 16, 2026 10:36
Upgrade actions/checkout to v4 and force a shallow checkout of the PR head (fetch-depth: 1, ref: PR head sha). Add comprehensive git debug steps and a non-failing baseline fetch using --shallow-since to reproduce/observe cases where the base branch history is missing (ensureRefsAvailable scenario). New checks include repo status, HEAD log, remotes, branch refs, show-ref for the baseline, merge-base attempt, recent logs, and detection of .git/shallow. Also add a brief echo before running the Endor Labs PR incremental scan. The fetches deliberately do not fail (|| true) to let downstream scan behavior be observed.
Replace the previous debug + shallow-fetch step with a scripted setup that forces the workflow to hit the ensureRefsAvailable fetch path. The new step obtains the base branch hash via git ls-remote, creates a refs/remotes/origin/<base> ref pointing to that hash (without fetching the commit object), verifies the ref, and asserts that the commit object is missing so downstream logic will attempt a shallow fetch. Also adds explanatory logging before the scan run and removes the previous time-based SHALLOW_DAYS shallow-fetch attempt. This makes the workflow deterministically reproduce the case where the baseline tip is not available locally and the job must fetch from origin.
Tidy and enhance the Endor Labs GitHub Actions workflow: fix branch array spacing, normalize step indentation, and revamp the setup step used to trigger the ensureRefsAvailable condition (line 274). The setup step now adds a SHALLOW_DAYS variable (default 30), will unshallow the repo if needed, and uses git fetch --shallow-since to create a branch ref without pulling older commit objects (replacing the previous update-ref approach). Additional checks and clearer logging were added to detect whether the commit object exists locally and to explain expected behavior when the ref exists but the object is missing. The Java build/download/run steps remain but received minor formatting/quoting normalization.
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch 3 times, most recently from e9b40ee to c917008 Compare February 17, 2026 15:27
@endor-lmoreno
endor-lmoreno changed the base branch from incremental_sast to main February 17, 2026 15:27
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch 3 times, most recently from e6509b2 to 8a24345 Compare February 17, 2026 16:43
@endor-lmoreno
endor-lmoreno changed the base branch from main to incremental_sast February 17, 2026 16:46
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch from 8a24345 to baa8021 Compare February 17, 2026 16:47
@endor-lmoreno
endor-lmoreno changed the base branch from incremental_sast to placeholder February 17, 2026 16:59
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch 2 times, most recently from 44426d4 to e71eb0a Compare February 17, 2026 17:16
@endor-lmoreno
endor-lmoreno force-pushed the incremental_sast_update branch from e71eb0a to eed275d Compare March 2, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant