Skip to content
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

make DependencySnapshot aware of multiple directories #8963

Merged
merged 19 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d5cc4f6
make DependencySnapshot aware of multiple directories
jakecoffman Feb 2, 2024
28532aa
add a failing test
jakecoffman Feb 2, 2024
6ec01bc
Merge branch 'main' into jakecoffman/fix-dependency-snapshot-multidir
jakecoffman Feb 7, 2024
c693d7b
fix types
jakecoffman Feb 7, 2024
aa1955c
handle multidir everywhere in dependency_snapshot
jakecoffman Feb 8, 2024
7322eac
assign all allowed in all directories
jakecoffman Feb 8, 2024
f36c04f
set the directory we're currently working for FileParser
jakecoffman Feb 8, 2024
e7acca0
reverse the order to make bad directory tests pass
jakecoffman Feb 8, 2024
76c0c48
Revert "reverse the order to make bad directory tests pass"
jakecoffman Feb 11, 2024
648d5ce
Merge branch 'main' into jakecoffman/fix-dependency-snapshot-multidir
jakecoffman Feb 13, 2024
47a264c
improve group operation applies_to and fix tests
jakecoffman Feb 13, 2024
d406aac
lint
jakecoffman Feb 13, 2024
63a440d
enable and improve version update multi-dir test
jakecoffman Feb 13, 2024
3b8df65
complex vu multi-dir pattern test with individual PRs
jakecoffman Feb 13, 2024
4f64e8f
Merge branch 'main' into jakecoffman/fix-dependency-snapshot-multidir
jakecoffman Feb 14, 2024
127c6fe
remove special case dependencies behavior for an explicit method
jakecoffman Feb 14, 2024
1d60f49
use current_directory= because it's a setter per PR feedback
jakecoffman Feb 14, 2024
9babae2
Merge branch 'main' into jakecoffman/fix-dependency-snapshot-multidir
jakecoffman Feb 22, 2024
501e924
Merge branch 'main' into jakecoffman/fix-dependency-snapshot-multidir
jakecoffman Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions silent/tests/testdata/su-group-pattern-multidir.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
stderr -count=1 'created \| related-a \( from 1.2.3 to 1.2.4 \), related-b \( from 2.3.4 to 2.3.5 \)'
stderr -count=1 'created \| dependency-c \( from 2.3.4 to 3.0.0 \)'
stderr -count=1 'created \| dependency-d \( from 2.3.4 to 3.0.0 \)'
stdout -count=3 create_pull_request
pr-created expected-group-foo.json expected-group-bar.json
pr-created expected-individual-1.json
pr-created expected-individual-2.json

-- foo/manifest.json --
{
"related-a": { "version": "1.2.3" },
"related-b": { "version": "2.3.4" },
"dependency-c": { "version": "2.3.4" }
}

-- bar/manifest.json --
{
"related-a": { "version": "1.2.3" },
"related-b": { "version": "2.3.4" },
"dependency-d": { "version": "2.3.4" }
}

-- expected-group-foo.json --
{
"related-a": { "version": "1.2.4" },
"related-b": { "version": "2.3.5" },
"dependency-c": { "version": "2.3.4" }
}

-- expected-group-bar.json --
{
"related-a": { "version": "1.2.4" },
"related-b": { "version": "2.3.5" },
"dependency-d": { "version": "2.3.4" }
}

-- expected-individual-1.json --
{
"related-a": { "version": "1.2.3" },
"related-b": { "version": "2.3.4" },
"dependency-c": { "version": "3.0.0" }
}

-- expected-individual-2.json --
{
"related-a": { "version": "1.2.3" },
"related-b": { "version": "2.3.4" },
"dependency-d": { "version": "3.0.0" }
}

-- related-a --
{
"versions": [
"1.2.3",
"1.2.4",
"1.2.5"
]
}

-- related-b --
{
"versions": [
"2.3.4",
"2.3.5"
]
}

-- dependency-c --
{
"versions": [
"2.3.4",
"3.0.0"
]
}

-- dependency-d --
{
"versions": [
"2.3.4",
"3.0.0"
]
}

-- input.yml --
job:
package-manager: "silent"
dependencies:
- related-a
- related-b
- dependency-c
- dependency-d
source:
directories:
- "/foo"
- "/bar/normalize-test/.."
provider: example
hostname: example.com
api-endpoint: https://example.com/api/v3
repo: dependabot/smoke-tests
security-advisories:
- dependency-name: related-a
affected-versions:
- < 1.2.4
patched-versions: []
unaffected-versions: []
- dependency-name: related-b
affected-versions:
- < 2.3.5
patched-versions: []
unaffected-versions: []
- dependency-name: dependency-c
affected-versions:
- < 2.3.5
patched-versions: []
unaffected-versions: []
- dependency-name: dependency-d
affected-versions:
- < 2.3.5
patched-versions: []
unaffected-versions: []
security-updates-only: true
dependency-groups:
- name: related
applies-to: security-updates
rules:
patterns:
- "related-*"
1 change: 1 addition & 0 deletions silent/tests/testdata/su-group-pattern.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
stderr -count=1 'created \| related-a \( from 1.2.3 to 1.2.4 \), related-b \( from 2.3.4 to 2.3.5 \)'
stderr -count=1 'created \| dependency-c \( from 2.3.4 to 3.0.0 \)'
stdout -count=2 create_pull_request
pr-created expected-group.json
pr-created expected-individual.json

Expand Down
4 changes: 2 additions & 2 deletions silent/tests/testdata/su-group-type.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
stdout -count=4 create_pull_request
stdout -count=2 create_pull_request
pr-created expected-dev-group.json
#pr-created expected-prod-group.json
pr-created expected-prod-group.json

-- manifest.json --
{
Expand Down
82 changes: 82 additions & 0 deletions silent/tests/testdata/vu-group-multidir-all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
stderr 'created \| dependency-a \( from 1.2.3 to 1.2.5 \), dependency-b \( from 2.2.3 to 2.2.5 \)'
pr-created foo/expected.json bar/expected.json

-- foo/manifest.json --
{
"dependency-a": { "version": "1.2.3" },
"dependency-b": { "version": "2.2.3" },
"no-update": { "version": "1.2.3" }
}

-- bar/manifest.json --
{
"dependency-b": { "version": "2.2.3" },
"dependency-c": { "version": "3.2.3" },
"no-update": { "version": "1.2.3" }
}

-- foo/expected.json --
{
"dependency-a": { "version": "1.2.5" },
"dependency-b": { "version": "2.2.5" },
"no-update": { "version": "1.2.3" }
}

-- bar/expected.json --
{
"dependency-b": { "version": "2.2.5" },
"dependency-c": { "version": "3.2.5" },
"no-update": { "version": "1.2.3" }
}

-- dependency-a --
{
"versions": [
"1.2.3",
"1.2.4",
"1.2.5"
]
}

-- dependency-b --
{
"versions": [
"2.2.3",
"2.2.4",
"2.2.5"
]
}

-- dependency-c --
{
"versions": [
"3.2.3",
"3.2.4",
"3.2.5"
]
}

-- no-update --
{
"versions": [
"1.2.3"
]
}

-- input.yml --
job:
package-manager: "silent"
source:
directories:
- "/foo"
- "/bar"
provider: example
hostname: example.com
api-endpoint: https://example.com/api/v3
repo: dependabot/smoke-tests
dependency-groups:
- name: first
rules:
patterns:
- "*"
99 changes: 99 additions & 0 deletions silent/tests/testdata/vu-group-multidir-pattern.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent
stdout -count=3 'create_pull_request'
pr-created foo/expected-group.json bar/expected-group.json
pr-created foo/expected-individual.json
pr-created bar/expected-individual.json

# Tests that the related dependencies are updated together, and the others get individual PRs.

-- foo/manifest.json --
{
"related-a": { "version": "1.2.3" },
"related-b": { "version": "1.2.3" },
"dependency-a": { "version": "1.2.3" }
}

-- bar/manifest.json --
{
"related-c": { "version": "1.2.3" },
"dependency-a": { "version": "1.2.3" }
}

-- foo/expected-group.json --
{
"related-a": { "version": "1.2.5" },
"related-b": { "version": "1.2.5" },
"dependency-a": { "version": "1.2.3" }
}

-- bar/expected-group.json --
{
"related-c": { "version": "1.2.5" },
"dependency-a": { "version": "1.2.3" }
}

-- foo/expected-individual.json --
{
"related-a": { "version": "1.2.3" },
"related-b": { "version": "1.2.3" },
"dependency-a": { "version": "1.2.5" }
}

-- bar/expected-individual.json --
{
"related-c": { "version": "1.2.3" },
"dependency-a": { "version": "1.2.5" }
}

-- dependency-a --
{
"versions": [
"1.2.3",
"1.2.4",
"1.2.5"
]
}

-- related-a --
{
"versions": [
"1.2.3",
"1.2.4",
"1.2.5"
]
}

-- related-b --
{
"versions": [
"1.2.3",
"1.2.4",
"1.2.5"
]
}

-- related-c --
{
"versions": [
"1.2.3",
"1.2.4",
"1.2.5"
]
}

-- input.yml --
job:
package-manager: "silent"
source:
directories:
- "/foo"
- "/bar"
provider: example
hostname: example.com
api-endpoint: https://example.com/api/v3
repo: dependabot/smoke-tests
dependency-groups:
- name: related
rules:
patterns:
- "related-*"
59 changes: 0 additions & 59 deletions silent/tests/testdata/vu-group-multidir.txt

This file was deleted.

Loading
Loading