@@ -25,6 +25,8 @@ def _fake_github_claims(**overrides):
2525def _fake_buildkite_claims (** overrides ):
2626 base = {
2727 "iss" : BUILDKITE_ISSUER ,
28+ "organization_id" : "org-uuid-123" ,
29+ "pipeline_id" : "pipe-uuid-456" ,
2830 "organization_slug" : "myorg" ,
2931 "pipeline_slug" : "mypipeline" ,
3032 "build_commit" : "abc123" ,
@@ -135,7 +137,7 @@ def setUp(self):
135137 self .mock_decode = self .patcher_decode .start ()
136138
137139 self ._orig_map = BUILDKITE_REPO_MAP .copy ()
138- load_ci_provider_mappings ({"buildkite" : {"myorg/mypipeline " : "myorg/myrepo" }})
140+ load_ci_provider_mappings ({"buildkite" : {"org-uuid-123/pipe-uuid-456 " : "myorg/myrepo" }})
139141
140142 def tearDown (self ):
141143 self .patcher_detect .stop ()
@@ -155,21 +157,21 @@ def test_valid_buildkite_token_returns_mapped_repo(self):
155157
156158 def test_unregistered_pipeline_raises_403 (self ):
157159 self .mock_decode .return_value = _fake_buildkite_claims (
158- organization_slug = "unknown" , pipeline_slug = "unknown"
160+ organization_id = "unknown-org " , pipeline_id = "unknown-pipe "
159161 )
160162 with self .assertRaises (HTTPException ) as ctx :
161163 verify_oidc_token ("bk.oidc.token" )
162164 self .assertEqual (ctx .exception .status_code , 403 )
163165 self .assertIn ("not registered" , ctx .exception .detail )
164166
165- def test_missing_org_slug_raises_401 (self ):
166- self .mock_decode .return_value = _fake_buildkite_claims (organization_slug = "" )
167+ def test_missing_org_id_raises_401 (self ):
168+ self .mock_decode .return_value = _fake_buildkite_claims (organization_id = "" )
167169 with self .assertRaises (HTTPException ) as ctx :
168170 verify_oidc_token ("bk.oidc.token" )
169171 self .assertEqual (ctx .exception .status_code , 401 )
170172
171- def test_missing_pipeline_slug_raises_401 (self ):
172- self .mock_decode .return_value = _fake_buildkite_claims (pipeline_slug = "" )
173+ def test_missing_pipeline_id_raises_401 (self ):
174+ self .mock_decode .return_value = _fake_buildkite_claims (pipeline_id = "" )
173175 with self .assertRaises (HTTPException ) as ctx :
174176 verify_oidc_token ("bk.oidc.token" )
175177 self .assertEqual (ctx .exception .status_code , 401 )
@@ -193,10 +195,10 @@ def tearDown(self):
193195 BUILDKITE_REPO_MAP .update (self ._orig_map )
194196
195197 def test_loads_valid_buildkite_entries (self ):
196- raw = {"buildkite" : {"vllm/ci " : "vllm-project/vllm" , "acme/build " : "acme/repo" }}
198+ raw = {"buildkite" : {"org-id-1/pipe-id-1 " : "vllm-project/vllm" , "org-id-2/pipe-id-2 " : "acme/repo" }}
197199 load_ci_provider_mappings (raw )
198- self .assertEqual (BUILDKITE_REPO_MAP [("vllm " , "ci " )], "vllm-project/vllm" )
199- self .assertEqual (BUILDKITE_REPO_MAP [("acme " , "build " )], "acme/repo" )
200+ self .assertEqual (BUILDKITE_REPO_MAP [("org-id-1 " , "pipe-id-1 " )], "vllm-project/vllm" )
201+ self .assertEqual (BUILDKITE_REPO_MAP [("org-id-2 " , "pipe-id-2 " )], "acme/repo" )
200202
201203 def test_empty_config_clears_map (self ):
202204 BUILDKITE_REPO_MAP [("old" , "entry" )] = "old/repo"
@@ -209,10 +211,10 @@ def test_missing_buildkite_section_clears_map(self):
209211 self .assertEqual (len (BUILDKITE_REPO_MAP ), 0 )
210212
211213 def test_skips_invalid_entries (self ):
212- raw = {"buildkite" : {"noslash" : "vllm-project/vllm" , "ok/pipeline " : "ok/repo" }}
214+ raw = {"buildkite" : {"noslash" : "vllm-project/vllm" , "ok-id/pipe-id " : "ok/repo" }}
213215 load_ci_provider_mappings (raw )
214216 self .assertNotIn (("noslash" , "" ), BUILDKITE_REPO_MAP )
215- self .assertEqual (BUILDKITE_REPO_MAP [("ok" , "pipeline " )], "ok/repo" )
217+ self .assertEqual (BUILDKITE_REPO_MAP [("ok-id " , "pipe-id " )], "ok/repo" )
216218
217219
218220class TestUnsupportedIssuer (unittest .TestCase ):
0 commit comments