Skip to content

Commit ec05cd8

Browse files
authored
Update metadata to use localhost for silent package manager (#12693)
- Changed hostname from example.com to 127.0.0.1 in metadata_finder.rb to ensure no network requests are made, maintaining the "silent" nature of the package manager. - Updated various test data files to replace example.com with 127.0.0.1 for consistency and to avoid external network calls during tests.
1 parent 6877264 commit ec05cd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+122
-120
lines changed

silent/lib/dependabot/silent/metadata_finder.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def homepage_url
1818

1919
sig { override.returns(Dependabot::Source) }
2020
def look_up_source
21+
# Use 127.0.0.1 as a non-routable hostname to avoid network requests
22+
# This ensures the silent package manager remains truly "silent"
2123
Dependabot::Source.new(
2224
provider: "example",
2325
hostname: "127.0.0.1",

silent/tests/testdata/err-fetching.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ job:
99
source:
1010
directory: "/"
1111
provider: example
12-
hostname: example.com
13-
api-endpoint: https://example.com/api/v3
12+
hostname: 127.0.0.1
13+
api-endpoint: http://127.0.0.1/api/v3
1414
repo: dependabot/smoke-tests

silent/tests/testdata/err-glob-not-found.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ job:
1010
directories:
1111
- "**/*"
1212
provider: example
13-
hostname: example.com
14-
api-endpoint: https://example.com/api/v3
13+
hostname: 127.0.0.1
14+
api-endpoint: http://127.0.0.1/api/v3
1515
repo: dependabot/smoke-tests

silent/tests/testdata/err-parsing.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ job:
2020
source:
2121
directory: "/"
2222
provider: example
23-
hostname: example.com
24-
api-endpoint: https://example.com/api/v3
23+
hostname: 127.0.0.1
24+
api-endpoint: http://127.0.0.1/api/v3
2525
repo: dependabot/smoke-tests

silent/tests/testdata/su-basic.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ job:
4747
source:
4848
directory: "/"
4949
provider: example
50-
hostname: example.com
51-
api-endpoint: https://example.com/api/v3
50+
hostname: 127.0.0.1
51+
api-endpoint: http://127.0.0.1/api/v3
5252
repo: dependabot/smoke-tests
5353
security-advisories:
5454
- dependency-name: dependency-a
@@ -72,8 +72,8 @@ job:
7272
source:
7373
directory: "/"
7474
provider: example
75-
hostname: example.com
76-
api-endpoint: https://example.com/api/v3
75+
hostname: 127.0.0.1
76+
api-endpoint: http://127.0.0.1/api/v3
7777
repo: dependabot/smoke-tests
7878
security-advisories:
7979
- dependency-name: dependency-a
@@ -101,8 +101,8 @@ job:
101101
source:
102102
directory: "/"
103103
provider: example
104-
hostname: example.com
105-
api-endpoint: https://example.com/api/v3
104+
hostname: 127.0.0.1
105+
api-endpoint: http://127.0.0.1/api/v3
106106
repo: dependabot/smoke-tests
107107
security-advisories:
108108
- dependency-name: dependency-a

silent/tests/testdata/su-err-all-versions-ignored-rebase.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ job:
2626
source:
2727
directory: "/"
2828
provider: example
29-
hostname: example.com
30-
api-endpoint: https://example.com/api/v3
29+
hostname: 127.0.0.1
30+
api-endpoint: http://127.0.0.1/api/v3
3131
repo: dependabot/smoke-tests
3232
security-advisories:
3333
- dependency-name: dependency-a

silent/tests/testdata/su-err-all-versions-ignored.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ job:
3131
source:
3232
directory: "/"
3333
provider: example
34-
hostname: example.com
35-
api-endpoint: https://example.com/api/v3
34+
hostname: 127.0.0.1
35+
api-endpoint: http://127.0.0.1/api/v3
3636
repo: dependabot/smoke-tests
3737
security-advisories:
3838
- dependency-name: dependency-a
@@ -52,8 +52,8 @@ job:
5252
source:
5353
directory: "/"
5454
provider: example
55-
hostname: example.com
56-
api-endpoint: https://example.com/api/v3
55+
hostname: 127.0.0.1
56+
api-endpoint: http://127.0.0.1/api/v3
5757
repo: dependabot/smoke-tests
5858
security-advisories:
5959
- dependency-name: dependency-a

silent/tests/testdata/su-err-dependency-not-found.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ job:
2525
source:
2626
directory: "/"
2727
provider: example
28-
hostname: example.com
29-
api-endpoint: https://example.com/api/v3
28+
hostname: 127.0.0.1
29+
api-endpoint: http://127.0.0.1/api/v3
3030
repo: dependabot/smoke-tests
3131
security-advisories:
3232
- dependency-name: not-found

silent/tests/testdata/su-err-not-found.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ job:
3535
source:
3636
directory: "/"
3737
provider: example
38-
hostname: example.com
39-
api-endpoint: https://example.com/api/v3
38+
hostname: 127.0.0.1
39+
api-endpoint: http://127.0.0.1/api/v3
4040
repo: dependabot/smoke-tests
4141
security-advisories:
4242
- dependency-name: dependency-a

silent/tests/testdata/su-err-not-needed.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ job:
2525
source:
2626
directory: "/"
2727
provider: example
28-
hostname: example.com
29-
api-endpoint: https://example.com/api/v3
28+
hostname: 127.0.0.1
29+
api-endpoint: http://127.0.0.1/api/v3
3030
repo: dependabot/smoke-tests
3131
security-advisories:
3232
- dependency-name: dependency-a

0 commit comments

Comments
 (0)