-
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.
test more of the security error scenarios (#9039)
- Loading branch information
1 parent
7e9d395
commit d63dd7e
Showing
4 changed files
with
156 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr security_update_dependency_not_found | ||
stdout '{"data":{"error-type":"security_update_dependency_not_found","error-details":{}},"type":"record_update_job_error"}' | ||
! stdout create_pull_request | ||
|
||
# Since 'not-found' is not in the manifest, it errors with security_update_dependency_not_found. | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.3" | ||
] | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- not-found | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: not-found | ||
affected-versions: | ||
- <= 1.2.3 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr security_update_not_needed | ||
stdout '{"data":{"error-type":"security_update_not_needed","error-details":{"dependency-name":"dependency-a"}},"type":"record_update_job_error"}' | ||
|
||
# The security update is not needed because 1.2.3 is not vulnerable according to the advisory given. | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.3", | ||
"1.2.4" | ||
] | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- < 1.0.0 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr pull_request_exists_for_latest_version | ||
stdout '{"data":{"error-type":"pull_request_exists_for_latest_version","error-details":{"dependency-name":"dependency-a","dependency-version":"1.2.5"}},"type":"record_update_job_error"}' | ||
|
||
# An existing pull request exists for 1.2.5 which is the latest version of dependency-a. | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.3", | ||
"1.2.4", | ||
"1.2.5" | ||
] | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- <= 1.2.3 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true | ||
existing-pull-requests: | ||
- - dependency-name: dependency-a | ||
dependency-version: 1.2.5 |
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,41 @@ | ||
! dependabot update -f input.yml --local . --updater-image ghcr.io/dependabot/dependabot-updater-silent | ||
stderr pull_request_exists_for_security_update | ||
stdout '{"data":{"error-type":"pull_request_exists_for_security_update","error-details":{"updated-dependencies":\[{"dependency-name":"dependency-a","dependency-version":"1.2.4"}\]}},"type":"record_update_job_error"}' | ||
|
||
# An existing pull request exists for 1.2.4, which is the security version required, but not the latest. | ||
|
||
-- manifest.json -- | ||
{ | ||
"dependency-a": { "version": "1.2.3" } | ||
} | ||
|
||
-- dependency-a -- | ||
{ | ||
"versions": [ | ||
"1.2.3", | ||
"1.2.4", | ||
"1.2.5" | ||
] | ||
} | ||
|
||
-- input.yml -- | ||
job: | ||
package-manager: "silent" | ||
dependencies: | ||
- dependency-a | ||
source: | ||
directory: "/" | ||
provider: example | ||
hostname: example.com | ||
api-endpoint: https://example.com/api/v3 | ||
repo: dependabot/smoke-tests | ||
security-advisories: | ||
- dependency-name: dependency-a | ||
affected-versions: | ||
- <= 1.2.3 | ||
patched-versions: [] | ||
unaffected-versions: [] | ||
security-updates-only: true | ||
existing-pull-requests: | ||
- - dependency-name: dependency-a | ||
dependency-version: 1.2.4 |