-
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
Open
leeyi45
wants to merge
20
commits into
master
Choose a base branch
from
workspaces-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+177
−5
Open
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a0ff005
Fix topo sort trying to read from packages that aren't within the rep…
leeyi45 9289750
Fix incorrect documentation url references
leeyi45 b4e6444
Fix coverage also including test utility files
leeyi45 362de6a
Fix devserver vite config not being linted
leeyi45 d94b6e4
Fix incorrect building commands for devserver
leeyi45 d717438
Fix the artifact command
leeyi45 abce599
Update workflows to not execute jobs at all if there were no detected…
leeyi45 d95597d
Update matrix jobs to properly not execute when they don't have to
leeyi45 7015382
Make devserver and docserver still execute even if the tabs or librar…
leeyi45 cc8ac68
Make end github job execute properly
leeyi45 a5c3d16
Remove trailing spaces
leeyi45 2eb8bed
Test including lockfile information for hasChanges
leeyi45 d08cb16
Linting and lodash import path fixes
leeyi45 f767caf
Fix incorrect package name processing
leeyi45 18fc8ef
Fix broken package names being used in commands
leeyi45 e8fde17
Merge
leeyi45 72f3f0a
Use Richard's implementation of lockfile change detection
leeyi45 9f5e8b8
Merge commit '8405f6cbc4edc432b7215f04acae9f40d117436a' into workspac…
leeyi45 921ad38
Fix typo
leeyi45 b5bc478
Fix incorrect null check
leeyi45 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { describe, expect, it, vi } from 'vitest'; | ||
| import * as utils from '../lockfiles.js'; | ||
|
|
||
| vi.mock(import('../gitRoot.js'), () => ({ | ||
| gitRoot: 'root' | ||
| })); | ||
|
|
||
| describe(utils.extractPackageName, () => { | ||
| it('works with packages that start with @', () => { | ||
| expect(utils.extractPackageName('@sourceacademy/tab-Rune@workspace:^')) | ||
| .toEqual('@sourceacademy/tab-Rune'); | ||
| }); | ||
|
|
||
| it('works with regular package names', () => { | ||
| expect(utils.extractPackageName('lodash@npm:^4.17.20')) | ||
| .toEqual('lodash'); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { getExecOutput } from '@actions/exec'; | ||
|
|
||
| // 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'); | ||
| return stdout.trim(); | ||
| } | ||
|
|
||
| /** | ||
| * Path to the root of the git repository | ||
| */ | ||
| export const gitRoot = await getGitRoot(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
getExecOutputis 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
getExecOutputfunction is called with the entire commandgit rev-parse --show-toplevelas a single string for thecommandparameter. The@actions/execAPI 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 togetExecOutput.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.