-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] multi-directory grouped updates sometimes create ungrouped PRs (#…
…9938) * spike * Scope updated_dependencies_list to the current file; fix ff checks * explicitly set updated_dependencies to an empty array if ff is not enabled * rubocop * call new method * Concat instead of + * fix undefined method `concat' for nil * Remove comment about adding directory to updated_dependencies_set * still add updated_dependencies to the global list * Add test to check the updated_dependency_files contain a list of updated_dependencies * lint * Add silent ecosystem tests from fix-handled-dependencies-for-multidir * Add #add_handled_group_dependencies method * Update add_handled_group_dependencies to take a Hash * Add unit tests for add_handled_grouped_dependencies from fix-handled-dependencies-for-multidir * disable perceived complexity for run_grouped_dependency_updates * dependency snapshot uses directory for tracking dependencies * track directory in dependency for deduce_updated_dependencies * add note about using dependency_snapshot.handled_dependencies * lint * spike * Scope updated_dependencies_list to the current file; fix ff checks * explicitly set updated_dependencies to an empty array if ff is not enabled * rubocop * call new method * Concat instead of + * fix undefined method `concat' for nil * Remove comment about adding directory to updated_dependencies_set * still add updated_dependencies to the global list * Add test to check the updated_dependency_files contain a list of updated_dependencies * lint * Change updated_dependencies to be a Symbol Co-authored-by: Landon Grindheim <landon.grindheim@gmail.com> * Reasign batch[file.path][:updated_dependencies] istead of zeroing it out * Use dig instead of directly accessing Hash * shold -> should --------- Co-authored-by: Landon Grindheim <landon.grindheim@gmail.com>
- Loading branch information
1 parent
5c6ef8d
commit 9307016
Showing
7 changed files
with
299 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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,81 @@ | ||
# Testing a grouped multi-dir configuration using semver rules. | ||
|
||
dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stdout -count=2 create_pull_request | ||
pr-created foo/expected-1.json bar/expected-1.json | ||
pr-created foo/expected-2.json | ||
|
||
# When there is the same dependency in both directories, one is a major update the other a patch, | ||
# and the user asked for majors in one group and minors in the other, we should create two group PRs | ||
|
||
-- foo/manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.0.0" }, | ||
"dependency-b": { "version": "2.0.0" } | ||
} | ||
|
||
-- bar/manifest.json -- | ||
{ | ||
"dependency-a": { "version": "2.0.0" }, | ||
"dependency-b": { "version": "1.0.0" } | ||
} | ||
|
||
-- foo/expected-1.json -- | ||
{ | ||
"dependency-a": { "version": "2.0.1" }, | ||
"dependency-b": { "version": "2.0.0" } | ||
} | ||
|
||
-- bar/expected-1.json -- | ||
{ | ||
"dependency-a": { "version": "2.0.0" }, | ||
"dependency-b": { "version": "2.0.1" } | ||
} | ||
|
||
-- foo/expected-2.json -- | ||
{ | ||
"dependency-a": { "version": "1.0.0" }, | ||
"dependency-b": { "version": "2.0.1" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.0.0", | ||
"2.0.0", | ||
"2.0.1" | ||
] | ||
} | ||
|
||
-- dependency-b -- | ||
{ | ||
"versions": [ | ||
"1.0.0", | ||
"2.0.0", | ||
"2.0.1" | ||
] | ||
} | ||
|
||
-- 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: major | ||
rules: | ||
update-types: | ||
- major | ||
- name: minor | ||
rules: | ||
update-types: | ||
- minor | ||
- patch | ||
experiments: | ||
dependency_has_directory: true |
This file contains 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 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 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 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.