-
Notifications
You must be signed in to change notification settings - Fork 32
Detect Changes based on Lockfile #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… changes for the corresponding package
…ies job doesn't execute
| // Not using the repotools version since this uses @action/exec instead of | ||
| // calling execFile from child_process | ||
| export async function getGitRoot() { | ||
| const { stdout } = await getExecOutput('git rev-parse --show-toplevel'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: getExecOutput is called with the full command string as the executable, instead of separating the command and its arguments.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The getExecOutput function is called with the entire command git rev-parse --show-toplevel as a single string for the command parameter. The @actions/exec API expects the executable and its arguments to be separate parameters. This will cause the shell to attempt to execute a non-existent command named "git rev-parse --show-toplevel", leading to a failure in the GitHub Actions workflow.
💡 Suggested Fix
Pass 'git' as the first argument and ['rev-parse', '--show-toplevel'] as the second argument to getExecOutput.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/actions/src/gitRoot.ts#L6
Potential issue: The `getExecOutput` function is called with the entire command `git
rev-parse --show-toplevel` as a single string for the `command` parameter. The
`@actions/exec` API expects the executable and its arguments to be separate parameters.
This will cause the shell to attempt to execute a non-existent command named `"git
rev-parse --show-toplevel"`, leading to a failure in the GitHub Actions workflow.
Did we get this right? 👍 / 👎 to inform future reviews.
| const { exitCode } = await getExecOutput( | ||
| 'git --no-pager diff --quiet origin/master -- yarn.lock', | ||
| [], | ||
| { | ||
| failOnStdErr: false, | ||
| ignoreReturnCode: true | ||
| } | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: getExecOutput is called with the full command string as the executable, instead of separating the command and its arguments.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The getExecOutput function is called with the entire command git --no-pager diff --quiet origin/master -- yarn.lock as a single string for the command parameter. The @actions/exec API expects the executable and its arguments to be separate parameters. This will cause the shell to attempt to execute a non-existent command named "git --no-pager diff --quiet origin/master -- yarn.lock", leading to a failure when checking lockfile changes.
💡 Suggested Fix
Pass 'git' as the first argument and ['--no-pager', 'diff', '--quiet', 'origin/master', '--', 'yarn.lock'] as the second argument to getExecOutput.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/actions/src/lockfiles.ts#L145-L152
Potential issue: The `getExecOutput` function is called with the entire command `git
--no-pager diff --quiet origin/master -- yarn.lock` as a single string for the `command`
parameter. The `@actions/exec` API expects the executable and its arguments to be
separate parameters. This will cause the shell to attempt to execute a non-existent
command named `"git --no-pager diff --quiet origin/master -- yarn.lock"`, leading to a
failure when checking lockfile changes.
Did we get this right? 👍 / 👎 to inform future reviews.
| }); | ||
| // focus all at once | ||
| const workspaces = tabsToBuild.map(each => `@sourceacademy/tab-${each}`); | ||
| const focusExitCode = await exec('yarn workspaces focus', workspaces, { silent: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: exec is called with the full command string as the executable, instead of separating the command and its arguments.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The exec function is called with the entire command yarn workspaces focus as a single string for the executable parameter. The @actions/exec API expects the executable and its arguments to be separate parameters. This will cause the shell to attempt to execute a non-existent command named "yarn workspaces focus", leading to a failure in the workspace focus command.
💡 Suggested Fix
Pass 'yarn' as the first argument and ['workspaces', 'focus', ...workspaces] as the second argument to exec.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/actions/src/load-artifacts/index.ts#L43
Potential issue: The `exec` function is called with the entire command `yarn workspaces
focus` as a single string for the `executable` parameter. The `@actions/exec` API
expects the executable and its arguments to be separate parameters. This will cause the
shell to attempt to execute a non-existent command named `"yarn workspaces focus"`,
leading to a failure in the workspace focus command.
Did we get this right? 👍 / 👎 to inform future reviews.
| const buildExitCode = await exec( | ||
| 'yarn workspaces foreach -pA', | ||
| [...workspaceBuildArgs, 'run', 'build'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: exec is called with the full command string as the executable, instead of separating the command and its arguments.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The exec function is called with the entire command yarn workspaces foreach -pA as a single string for the executable parameter. The @actions/exec API expects the executable and its arguments to be separate parameters. This will cause the shell to attempt to execute a non-existent command named "yarn workspaces foreach -pA", leading to a failure in the build command.
💡 Suggested Fix
Pass 'yarn' as the first argument and ['workspaces', 'foreach', '-pA', ...workspaceBuildArgs, 'run', 'build'] as the second argument to exec.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/actions/src/load-artifacts/index.ts#L50-L52
Potential issue: The `exec` function is called with the entire command `yarn workspaces
foreach -pA` as a single string for the `executable` parameter. The `@actions/exec` API
expects the executable and its arguments to be separate parameters. This will cause the
shell to attempt to execute a non-existent command named `"yarn workspaces foreach
-pA"`, leading to a failure in the build command.
Did we get this right? 👍 / 👎 to inform future reviews.
…es-fix # Conflicts: # .github/actions/src/gitRoot.ts # .github/actions/src/info/__tests__/index.test.ts # .github/actions/src/info/index.ts
|
Also no need to merge just yet, there are probably other things I need to add |
@RichDom2185 provided some code that would help detect which workspaces need to be rebuilt based on diffs across lockfiles. This PR will implement that change, as well as fix some typos in the documentation.