| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR refactors diff-informed analysis functionality by moving diff-range computation logic and associated tests from analyze.ts to diff-informed-analysis-utils.ts. The changes prepare for future work where diff-range computation will occur during the init action instead of the analyze action.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| src/diff-informed-analysis-utils.ts | Added diff-range computation functions and FileDiff interface previously in analyze.ts |
| src/diff-informed-analysis-utils.test.ts | Added test cases for getDiffRanges function moved from analyze.test.ts |
| src/analyze.ts | Removed diff-range computation functions, updated imports to use new exports from diff-informed-analysis-utils |
| src/analyze.test.ts | Removed getDiffRanges test cases now in diff-informed-analysis-utils.test.ts |
| lib/analyze-action.js | Generated JavaScript reflecting the TypeScript changes |
Sorry, something went wrong.
There was a problem hiding this comment.
This change looks OK. I am wondering if it would be better to move this to somewhere like api-client.ts though, since there isn't really anything specific to diff-informed queries.
Sorry, something went wrong.
| // uses forward slashes as the path separator, so on Windows we need to | ||
| // replace any backslashes with forward slashes. | ||
| const filename = path | ||
| .join(actionsUtil.getRequiredInput("checkout_path"), fileDiff.filename) |
There was a problem hiding this comment.
I note that this input is specific to the analyze and upload-sarif actions, so this will need some kind of change if you are planning to call it from the init action in a follow-up change.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the pointer. I will keep that in mind for the next changes.
Sorry, something went wrong.
I think an argument can be made both ways. It is somewhat specific to diff-informed analysis in that getDiffRanges (and consequently getPullRequestEditedDiffRanges) is designed to return the information needed specifically for diff-informed analysis rather than all the information returned by compareCommitsWithBasehead. In particular, diff-informed analysis currently works at a file-level granularity and therefore the functions don't return any column information even though it could be extracted. I am happy to move the functions to api-client.ts if you prefer. |
Sorry, something went wrong.
|
No strong feelings. I am happy that some parts are specific to diff-informed analysis and, while there might be parts we could extract for more general usage, we can always do that if/when we actually need them for something else. Feel free to merge this as-is. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR moves the diff-range computations and associated tests into diff-informed-analysis-utils as preparation for a future PR where the diff-range computation will be performed during the init action instead of the analyze action. The PR is intended to be a pure refactoring, without any observable effects.
The two commits are derived from splitting the first commit from #3192.
Diff-informed analysis is guarded by the diff_informed_queries feature flag. The diff_informed_queries flag is already fully rolled out.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
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?
Merge / deployment checklist