| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR updates git OID handling to support SHA-256 repositories (64-hex object IDs) in the CodeQL Action, and adds unit tests to validate the updated parsing behavior.
Changes:
| File | Description |
|---|---|
| src/git-utils.ts | Updates OID length assumptions and ls-files parsing to support SHA-256. |
| src/git-utils.test.ts | Adds unit tests for SHA-256 OIDs and invalid OID lengths. |
| CHANGELOG.md | Records the new SHA-256 git object ID support as an unreleased change. |
| lib/upload-sarif-action.js | Generated JS output reflecting the TypeScript changes. |
| lib/upload-lib.js | Generated JS output reflecting the TypeScript changes. |
| lib/setup-codeql-action.js | Generated JS output reflecting the TypeScript changes. |
| lib/resolve-environment-action.js | Generated JS output reflecting the TypeScript changes. |
| lib/init-action.js | Generated JS output reflecting the TypeScript changes. |
| lib/init-action-post.js | Generated JS output reflecting the TypeScript changes. |
| lib/autobuild-action.js | Generated JS output reflecting the TypeScript changes. |
| lib/analyze-action.js | Generated JS output reflecting the TypeScript changes. |
| lib/analyze-action-post.js | Generated JS output reflecting the TypeScript changes. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for picking this up!
Sorry, something went wrong.
| // The fields are: <mode> <oid> <stage>\t<path> | ||
| const regex = /^[0-9]+ ([0-9a-f]{40}) [0-9]+\t(.+)$/; | ||
| // The OID is either 40 (SHA-1) or 64 (SHA-256) hex characters. | ||
| const regex = /^[0-9]+ ([0-9a-f]{40}|[0-9a-f]{64}) [0-9]+\t(.+)$/; |
There was a problem hiding this comment.
Nice, I think this is a cleaner approach than what was suggested on the other PR.
Sorry, something went wrong.
| } finally { | ||
| runGitCommandStub.restore(); | ||
| } |
There was a problem hiding this comment.
Minor: I don't think the restore call is needed since that should happen automatically.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Update assumptions about Git OIDs to support SHA-256 OIDs, and add unit tests.
This incorporates review feedback from #3872.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist