Skip to content

fix(cli): remove duplicate --invocation-source add_argument definition#211

Draft
daeunJe0ng with Copilot wants to merge 10 commits into
mainfrom
copilot/fix-lint-python-job
Draft

fix(cli): remove duplicate --invocation-source add_argument definition#211
daeunJe0ng with Copilot wants to merge 10 commits into
mainfrom
copilot/fix-lint-python-job

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The "Lint Python" CI job was failing on PR #197 due to a malformed add_argument call in cli.py where an old and new definition of --invocation-source were accidentally merged into a single call, producing four invalid-syntax errors from ruff.

What was broken

parser.add_argument(
    "--invocation-source", default="cli",           # old definition
    choices=["adk", "installer", "cli"],
    help="...",
    "--invocation-source", default=None,            # new definition — positional after kwarg
    choices=["adk", "installer", "cli", "connect"], # duplicate kwarg
    help="...",                                     # duplicate kwarg
)

Errors:

  • E999 invalid-syntax: Positional argument cannot follow keyword argument
  • Duplicate keyword arguments: default, choices, help

Fix

Removed the stale first definition; kept only the updated one (default=None, choices includes "connect", help text documents the per-mode defaults):

parser.add_argument(
    "--invocation-source", default=None,
    choices=["adk", "installer", "cli", "connect"],
    help="How FlightCheck was invoked (adk=slash-command, installer=standalone "
         "installer, cli=direct Python CLI, connect=incremental single-checkpoint "
         "run from a connect/setup skill). Default: cli for --scope runs, connect "
         "for --checkpoint runs.",
)

This PR also incorporates the full INFRA-003 feature branch (PR #197) so the fix lands with the code that introduced it.

daeunJe0ng and others added 9 commits July 16, 2026 09:49
…h blocked HR-system endpoints before deployment)

Enumerates the external system endpoints the agent's installed extensions
use (Workday, ServiceNow, SAP SuccessFactors, custom HTTP) and verifies
each is reachable, so blocked endpoints are surfaced during preflight
rather than by real employees at runtime.

Default path is a read-only, idempotent local TCP/TLS probe (reuses
probe_endpoint), keeping AC7 intact. The opt-in --live-probe egress path
(transient Power Automate flow) is scaffolded but deferred: it stays
gated until the flow lifecycle API is captured into the tier registry.

Adds the design decision doc, the five-field role-aware remediation
schema per Shared Steps, a SAS sig= redaction rule for flow callback
URLs, the capture wrapper, and unit tests (all-reachable / one-blocked /
dns-fail / cert-error / timeout).

Work item: 7485387

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61b2ed77-ecdd-4ec2-9790-844616e09afc
…taverse flow (prove reachability from Power Platform egress, not the maker's machine)

Adds the opt-in, consent-gated live egress probe for INFRA-003, resolving the
AC7 / user-consent decision. The default path stays read-only; --live-probe is
the kit's only mutating path and is fully isolated and self-cleaning.

- live_egress_probe.py: isolated create/activate/callback/invoke/delete
  orchestration over the supported Dataverse workflow-table lifecycle
  (category 5), with guaranteed cleanup and deterministic-name orphan sweep.
- infrastructure.py: wire the --live-probe branch into
  check_external_endpoint_reachability, with per-endpoint fallback to the
  local probe when the egress probe is indeterminate.
- power_automate.py mock (validated) plus flightcheck_infra003_flow.yaml
  cassette backing the live path; INDEX.md confirmed-endpoint rows.
- _common.py: redact dashless split Power Platform env-id runtime hostnames.
- Docs: design AC7 tension resolved; validation-matrix and SKILL wording.

Tests: test_infra_003_live_probe.py (reachable / blocked / indeterminate
fallback / cleanup) plus a redaction test. Full flightcheck and captures
suites green.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61b2ed77-ecdd-4ec2-9790-844616e09afc
…d reassurances + decline/manual-verify path)

Step 2b now leads with what the probe does and why, keeps the two trust
anchors (no business data touched, flow auto-deleted), and adds the
previously missing "user declines" path with manual allowlist-verification
steps and the Microsoft outbound-IP doc link. <SYSTEM> stays swappable so
one string serves Workday / ServiceNow / SuccessFactors / custom HTTP.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61b2ed77-ecdd-4ec2-9790-844616e09afc
… consent (INFRA-003)

Rename --live-probe to --runtime-reachability (tri-state) and add a proactive Y/N consent offer on interactive terminal runs; keep ADK consent conversational. On decline, surface manual IP-allowlist links (outbound-IP article + Azure service-tags JSON). Restores the argparse block dropped by merge e998729.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 60fb8df5-d7e3-48e9-8f3e-382d5c6cc2f4
…ort + cover consent gate (INFRA-003)

The declined + locally-reachable path emitted the outbound-IP and service-tags
links in the PASSED row's result field, which report.html escapes but does not
linkify, so they leaked as raw markdown. Move them to remediation (the linkified
channel) so they render as clickable anchors; the plain skip caveat stays in
result. Also drops a duplicate-links side effect on declined FAILED/WARNING rows.

Adds automated coverage for the env-only scenarios: the CLI consent gate
(_apply_runtime_reachability_consent) which had none - forced on/off, interactive
Y/N, non-tty/CI, no-endpoints, ADK-never-prompts, infra-out-of-scope - plus
delete-failure resilience and delete_probe_flow unit tests for the egress probe.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 60fb8df5-d7e3-48e9-8f3e-382d5c6cc2f4
…n causing lint errors

The parser.add_argument('--invocation-source', ...) call in cli.py contained
two conflicting definitions merged into one call (old + new). This caused four
ruff invalid-syntax errors:
- Positional argument cannot follow keyword argument (line 566)
- Duplicate keyword argument 'default' (line 566)
- Duplicate keyword argument 'choices' (line 567)
- Duplicate keyword argument 'help' (line 568)

Fix: remove the old definition (default='cli', choices without 'connect') and
keep only the new expanded definition (default=None, choices includes 'connect',
updated help text explaining the per-mode defaults).

Co-authored-by: daeunJe0ng <58056908+daeunJe0ng@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions job 'Lint Python' fix(cli): remove duplicate --invocation-source add_argument definition Jul 22, 2026
Copilot AI requested a review from daeunJe0ng July 22, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants