Skip to content

Commit 91044fb

Browse files
fix(dso-7nos): add ACLI auth login step to bridge workflows
ACLI Go binary requires explicit `acli jira auth login --site --email --token` before any Jira API calls. The legacy Java ACLI read credentials from env vars automatically, but the Go binary stores auth in a config file after login. Changes: - Add "Authenticate ACLI" step to both inbound and outbound bridge workflows, piping JIRA_API_TOKEN to acli auth login via stdin - Simplify AcliClient._run() to delegate to _run_acli() since auth is now handled at the workflow level - Add design note to dso-7nos: tickets branch must be synced from main for code changes to take effect in bridge workflows Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4c6ef71 commit 91044fb

File tree

5 files changed

+38
-30
lines changed

5 files changed

+38
-30
lines changed

.github/workflows/inbound-bridge.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ jobs:
115115
fi
116116
ln -sf "$HOME/.acli/acli" /usr/local/bin/acli
117117
118+
- name: Authenticate ACLI
119+
run: |
120+
# ACLI Go binary requires explicit auth login (no env var auto-detection).
121+
# Pipe the API token to stdin via --token flag.
122+
echo "$JIRA_API_TOKEN" | acli jira auth login \
123+
--site "$JIRA_URL" \
124+
--email "$JIRA_USER" \
125+
--token
126+
env:
127+
JIRA_URL: ${{ vars.JIRA_URL }}
128+
JIRA_USER: ${{ vars.JIRA_USER }}
129+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
130+
118131
- name: Run inbound bridge
119132
id: run-bridge
120133
run: |

.github/workflows/outbound-bridge.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ jobs:
109109
fi
110110
ln -sf "$HOME/.acli/acli" /usr/local/bin/acli
111111
112+
- name: Authenticate ACLI
113+
run: |
114+
echo "$JIRA_API_TOKEN" | acli jira auth login \
115+
--site "$JIRA_URL" \
116+
--email "$JIRA_USER" \
117+
--token
118+
env:
119+
JIRA_URL: ${{ vars.JIRA_URL }}
120+
JIRA_USER: ${{ vars.JIRA_USER }}
121+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
122+
112123
- name: Run outbound bridge
113124
id: run-bridge
114125
run: |

.tickets/.sync-state.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@
449449
"last_synced": "2026-03-19T18:38:35Z",
450450
"local_hash": "14c516947a151a3db8bdec4010e2fd6e"
451451
},
452-
"last_pull_timestamp": "2026-03-23T04:29:36Z",
453-
"last_sync_commit": "bc822f030eb394ef13e5f0bd21e64707e0885fcf",
452+
"last_pull_timestamp": "2026-03-23T04:34:32Z",
453+
"last_sync_commit": "4c6ef71950fbe947a5818805e055ecc831a7e618",
454454
"w21-5cqr": {
455455
"jira_hash": "bce29d76f01c58613ee99cb1dd03920d",
456456
"jira_key": "DIG-61",

.tickets/dso-7nos.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ Phase 2: Add ACLI version/hash configuration to the project setup guided prompts
2525

2626
## Notes
2727
Originally tracked as bug dso-7nos (ACLI_VERSION unset). Upgraded to epic per user request to automate the full configuration lifecycle.
28+
29+
**2026-03-23T04:39:18Z**
30+
31+
Design decision: The Inbound Bridge workflow checks out ref:tickets — not main. This means all code (including bridge scripts and workflow changes) must be present on the tickets branch. Currently achieved by pushing main → tickets to sync. Long-term, the workflow should be restructured to checkout main for code and only use the tickets branch for .tickets-tracker/ data — this avoids coupling code deployment to the tickets branch sync cycle.

plugins/dso/scripts/acli-integration.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -229,34 +229,14 @@ def __init__(
229229
self._acli_cmd = acli_cmd
230230

231231
def _run(self, cmd: list[str]) -> subprocess.CompletedProcess[str]:
232-
"""Run an ACLI command with credentials injected into env."""
233-
base = self._acli_cmd if self._acli_cmd is not None else _DEFAULT_ACLI_CMD
234-
full_cmd = base + cmd
235-
env = _build_env()
236-
env["JIRA_URL"] = self.jira_url
237-
env["JIRA_USER"] = self.user
238-
env["JIRA_API_TOKEN"] = self.api_token
239-
240-
last_error: subprocess.CalledProcessError | None = None
241-
for attempt in range(_MAX_ATTEMPTS):
242-
try:
243-
return subprocess.run(
244-
full_cmd,
245-
capture_output=True,
246-
text=True,
247-
check=True,
248-
env=env,
249-
)
250-
except subprocess.CalledProcessError as exc:
251-
last_error = exc
252-
if exc.returncode == _AUTH_FAILURE_CODE:
253-
raise
254-
if attempt < _MAX_ATTEMPTS - 1:
255-
delay = 2 ** (attempt + 1)
256-
time.sleep(delay)
257-
258-
assert last_error is not None
259-
raise last_error
232+
"""Run an ACLI command.
233+
234+
ACLI Go reads auth from its config file (set by ``acli auth login``).
235+
Credentials stored on self are available for callers that need them
236+
(e.g., direct REST calls), but are not injected into the subprocess
237+
environment — ACLI does not read env vars for auth.
238+
"""
239+
return _run_acli(cmd, acli_cmd=self._acli_cmd)
260240

261241
def search_issues(
262242
self,

0 commit comments

Comments
 (0)