Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/actions/issuelens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ identity check is not authorization for any additional repositories named by a t
| `source-run-attempt` | With `source-run-id` | Positive originating run attempt. |
| `push-before`, `push-after` | With `source-run-id` | Full nonzero requested ancestor/source-run-head SHAs. Supply all four run/range inputs, never with `pull-request-number`. Before is not an attested original event boundary. |
| `transport` | No | `foundry` (default for existing callers) or `bridge` (IssueLens pilot only). |
| `bridge-url` | For `bridge` | Complete approved HTTPS Azure Function jobs endpoint. |
| `bridge-url` | For `bridge` | Complete approved HTTPS Azure Function jobs endpoint. Pass it from the `ISSUELENS_BRIDGE_URL` Actions secret, not a configuration variable. |
| `azure-client-id` | For `foundry` | Existing Azure OIDC identity's client ID. |
| `azure-tenant-id` | For `foundry` | Tenant used by Azure login. |
| `azure-subscription-id` | For `foundry` | Subscription used by Azure login. |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# .github/issuelens.yml, not in this workflow.
#
# After the isolated Function bridge is approved, set the ISSUELENS_BRIDGE_URL
# repository variable and opt in with ISSUELENS_ISSUE_LOOP_ENABLED=true.
# repository secret and opt in with ISSUELENS_ISSUE_LOOP_ENABLED=true.
# This workflow authenticates only to the bridge. The worker's Azure identity
# invokes Foundry; the hosted agent still owns all GitHub App writes.

Expand Down Expand Up @@ -36,7 +36,6 @@ jobs:
orchestrate:
if: >-
vars.ISSUELENS_ISSUE_LOOP_ENABLED == 'true' &&
vars.ISSUELENS_BRIDGE_URL != '' &&
github.repository == 'microsoft/IssueLens' &&
(github.event_name != 'issue_comment' ||
(github.event.issue.pull_request == null &&
Expand All @@ -45,12 +44,15 @@ jobs:
github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
runs-on: ubuntu-latest
timeout-minutes: 45
env:
ISSUELENS_BRIDGE_CONFIGURED: ${{ secrets.ISSUELENS_BRIDGE_URL != '' && 'true' || 'false' }}
permissions:
contents: read
issues: read
id-token: write
steps:
- name: Load action from trusted workflow revision
if: env.ISSUELENS_BRIDGE_CONFIGURED == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.workflow_sha }}
Expand All @@ -59,9 +61,10 @@ jobs:
sparse-checkout-cone-mode: false

- name: Process issue event
if: env.ISSUELENS_BRIDGE_CONFIGURED == 'true'
uses: ./.github/actions/issuelens
with:
request-type: issue-loop
issue-number: ${{ inputs.issue_number }}
transport: bridge
bridge-url: ${{ vars.ISSUELENS_BRIDGE_URL }}
bridge-url: ${{ secrets.ISSUELENS_BRIDGE_URL }}
7 changes: 5 additions & 2 deletions .github/workflows/team-memory-coordinator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ jobs:
if: >-
(vars.ISSUELENS_TEAM_MEMORY_ENABLED == 'true' ||
(vars.ISSUELENS_TEAM_MEMORY_MANUAL_PILOT == 'true' && inputs.pull_request_number != '')) &&
vars.ISSUELENS_BRIDGE_URL != '' &&
github.repository == 'microsoft/IssueLens' &&
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) &&
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 45
env:
ISSUELENS_BRIDGE_CONFIGURED: ${{ secrets.ISSUELENS_BRIDGE_URL != '' && 'true' || 'false' }}
permissions:
contents: read
pull-requests: read
actions: read
id-token: write
steps:
- name: Load action from trusted workflow revision
if: env.ISSUELENS_BRIDGE_CONFIGURED == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.workflow_sha }}
Expand All @@ -61,6 +63,7 @@ jobs:
sparse-checkout-cone-mode: false

- name: Maintain team memory
if: env.ISSUELENS_BRIDGE_CONFIGURED == 'true'
uses: ./.github/actions/issuelens
with:
request-type: team-memory
Expand All @@ -71,4 +74,4 @@ jobs:
push-after: ${{ inputs.push_after }}
pull-request-number: ${{ inputs.pull_request_number }}
transport: bridge
bridge-url: ${{ vars.ISSUELENS_BRIDGE_URL }}
bridge-url: ${{ secrets.ISSUELENS_BRIDGE_URL }}
8 changes: 5 additions & 3 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1092,9 +1092,11 @@ Keep direct endpoint access limited to approved callers. The GitHub workflow
for deploying the agent is separate from this migration and still requires
an approved replacement for its retired identity.

Set the repository variable `ISSUELENS_BRIDGE_URL` to the approved ingress
jobs URL only when the bridge and worker RBAC are ready. Verify that
out-of-scope workflows and jobs are rejected before enabling the workflows.
Set the Actions repository secret `ISSUELENS_BRIDGE_URL` to the approved
ingress jobs URL only when the bridge and worker RBAC are ready. Do not keep
a repository variable with the same name. If the secret is unavailable, the
workflows skip checkout and invocation. Verify that out-of-scope workflows
and jobs are rejected before enabling the workflows.
The existing deployed agent can write, so treat a live invocation as a
write-capable test, not a dry run. After approval, set
`ISSUELENS_ISSUE_LOOP_ENABLED=true` for issue events. Enable
Expand Down
9 changes: 7 additions & 2 deletions tests/test_issue_triage_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ def test_caller_is_thin_and_loads_trusted_action(self):
self.assertEqual(invoke["uses"], "./.github/actions/issuelens")
self.assertEqual(invoke["with"]["request-type"], "issue-loop")
self.assertEqual(invoke["with"]["transport"], "bridge")
self.assertEqual(invoke["with"]["bridge-url"], "${{ vars.ISSUELENS_BRIDGE_URL }}")
self.assertEqual(invoke["with"]["bridge-url"], "${{ secrets.ISSUELENS_BRIDGE_URL }}")
self.assertEqual(self.job["env"], {
"ISSUELENS_BRIDGE_CONFIGURED": "${{ secrets.ISSUELENS_BRIDGE_URL != '' && 'true' || 'false' }}",
})
for step in (checkout, invoke):
self.assertEqual(step["if"], "env.ISSUELENS_BRIDGE_CONFIGURED == 'true'")
self.assertEqual(invoke["with"]["issue-number"], "${{ inputs.issue_number }}")
self.assertIn("vars.ISSUELENS_ISSUE_LOOP_ENABLED == 'true'", self.job["if"])
self.assertIn("vars.ISSUELENS_BRIDGE_URL != ''", self.job["if"])
self.assertNotIn("ISSUELENS_BRIDGE_URL", self.job["if"])
self.assertIn("github.repository == 'microsoft/IssueLens'", self.job["if"])
self.assertNotIn("secrets.AZURE_", self.source)
self.assertEqual(self.workflow["permissions"], {})
Expand Down
9 changes: 7 additions & 2 deletions tests/test_team_memory_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,13 @@ def test_local_caller_loads_only_trusted_action_revision(self):
self.assertEqual(invoke["uses"], "./.github/actions/issuelens")
self.assertEqual(invoke["with"]["request-type"], "team-memory")
self.assertEqual(invoke["with"]["transport"], "bridge")
self.assertEqual(invoke["with"]["bridge-url"], "${{ vars.ISSUELENS_BRIDGE_URL }}")
self.assertIn("vars.ISSUELENS_BRIDGE_URL != ''", self.job["if"])
self.assertEqual(invoke["with"]["bridge-url"], "${{ secrets.ISSUELENS_BRIDGE_URL }}")
self.assertEqual(self.job["env"], {
"ISSUELENS_BRIDGE_CONFIGURED": "${{ secrets.ISSUELENS_BRIDGE_URL != '' && 'true' || 'false' }}",
})
for step in (checkout, invoke):
self.assertEqual(step["if"], "env.ISSUELENS_BRIDGE_CONFIGURED == 'true'")
self.assertNotIn("ISSUELENS_BRIDGE_URL", self.job["if"])
self.assertIn("vars.ISSUELENS_TEAM_MEMORY_MANUAL_PILOT == 'true' && inputs.pull_request_number != ''", self.job["if"])
self.assertNotIn("secrets.AZURE_", self.source)
self.assertTrue(set(invoke["with"]).issubset(self.action_metadata["inputs"]))
Expand Down