We are trying to enable Pull Request analysis for a TypeScript/JS project using Bamboo. The main branch analysis works properly, however PR analysis displays No code files were found for analysis.under the Code tab of the PR analysis output. I’ve enable fetching the full repository to avoid shallow clones. I’ve attached the debug logs. You can see the scanner is detecting the new/changed files, but they are not appearing in the analysis in the app.
Do you know the command that is used to determine changed lines in the branch? This PR that we are analyzing has a number of new and changed code files in it.
Exception caught during execution of command '[/usr/bin/git, config, --system, --show-origin, --list, -z]' in '/usr/bin', return code '128', error message 'fatal: unable to read config file '/etc/gitconfig': No such file or directory
Can you try setting up /etc/gitconfig and running it again?
The pull request source branch is checked out in the local repository.
The branch being targeted by the pull request is fetched and present in the local repository.
The analysis is being run on a local repository with valid repository metadata (e.g. the .git folders have not been removed). Avoid any attempt at previewing the merge or actions involving your main branch.
The code in the local repository matches the code in the remote repository (e.g once a PR is issued, no code is added to the local branch on the CI side before analysis).
(Yes, I know we’ve got the git diff origin/main at the top of the log.)
The pull request source branch is checked out in the local repository.
Yes, output of git branch --show-current is feature/browser-component
The branch being targeted by the pull request is fetched and present in the local repository.
Yes, main branch is fetched as shown by git diff output
The analysis is being run on a local repository with valid repository metadata (e.g. the .git folders have not been removed). Avoid any attempt at previewing the merge or actions involving your main branch.
Yes
The code in the local repository matches the code in the remote repository (e.g once a PR is issued, no code is added to the local branch on the CI side before analysis).
Yes
The diff you have created is done against origin/main, but in fact scanner at first, is trying to execute diff against local ref main , could you execute the same scan, but do a diff against main rather than origin/main?
Something like git diff main instead git diff origin/main
Thank you for all your help. I found the issue and feel very dumb. I had the branch and base values for the PR reversed. Your comment on the merge base was the key. I finally noticed the log message INFO: Pull request 10 for merge into feature/storybook-docs from main.