Skip to content

ci: let Dependabot integration tests run via pull_request_target#199

Open
ionmincu wants to merge 4 commits into
mainfrom
ci/dependabot-config-and-test-hardening
Open

ci: let Dependabot integration tests run via pull_request_target#199
ionmincu wants to merge 4 commits into
mainfrom
ci/dependabot-config-and-test-hardening

Conversation

@ionmincu
Copy link
Copy Markdown
Collaborator

@ionmincu ionmincu commented May 13, 2026

Summary

Make Dependabot PRs actually able to run integration tests, ported from uipath-python PR #1628:

  • Dual triggers: pull_request_target added alongside pull_request, restricted to [opened, synchronize, reopened]. Both jobs gated by actor: pull_request runs for everyone except dependabot[bot], pull_request_target runs only for dependabot[bot]. No double-runs, no secrets exposed to fork PRs.
  • actions/checkout uses ref: ${{ github.event.pull_request.head.sha || github.sha }} in both

Mirror the dependabot.yml from uipath-python and uipath-langchain-python
so version-update PRs are not opened. They could not pass integration
tests because GitHub does not pass repository secrets to workflows
triggered by dependabot, leaving uipath auth without credentials.

Add timeout-minutes: 10 to the integration-tests job so hung jobs do
not sit "in progress" indefinitely. Add set -e to each run.sh so the
first failure is surfaced instead of cascading through init/pack/run
and ending with a misleading "UIPATH_ACCESS_TOKEN is not set".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 13, 2026 16:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates repository automation to reduce CI churn from Dependabot and make integration test execution more fail-fast and bounded in duration.

Changes:

  • Added a .github/dependabot.yml configuration that disables new Dependabot version-bump PRs (open-pull-requests-limit: 0) and excludes samples/**.
  • Added timeout-minutes: 10 to the GitHub Actions integration-tests job to prevent indefinite hangs.
  • Hardened the three integration testcase run.sh scripts by enabling set -e and preserving MCP server log output even when test.py fails.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testcases/string-server/run.sh Enable set -e and capture test failures while still printing mcp_server_output.log.
testcases/ground-to-cloud/run.sh Same hardening as above for the ground-to-cloud testcase script.
testcases/datetime-server/run.sh Same hardening as above for the datetime testcase script.
.github/workflows/integration_tests.yml Add a 10-minute timeout to each integration test job to avoid stuck runs.
.github/dependabot.yml Add Dependabot configuration to stop opening new dependency PRs (and exclude samples).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Supersedes the dependabot.yml disable from the previous commit: instead
of blocking Dependabot from opening PRs, let them run integration tests
with secrets in scope. Port the pattern from uipath-python PR #1628:

- Add pull_request_target trigger alongside pull_request. Both gated by
  actor so each event fires only for its intended PR source — no
  double-runs and no secrets exposed to arbitrary fork PRs.
- Restrict the Dependabot matrix to alpha only to minimize the blast
  radius of running PR code with credentials in scope.
- actions/checkout uses ref: head.sha in both jobs so the PR's code is
  tested under pull_request_target (which defaults to base otherwise).
- Add a Check secrets availability step that emits a ::warning::
  annotation when CLIENT_ID/CLIENT_SECRET/BASE_URL arrive empty, so
  fork-PR failures have clear context instead of cascading into a
  misleading UIPATH_ACCESS_TOKEN error downstream.

set -e in run.sh and timeout-minutes from the previous commit are kept
as-is.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ionmincu ionmincu changed the title ci: add dependabot config and harden integration test scripts ci: let Dependabot integration tests run via pull_request_target May 13, 2026
Comment thread .github/workflows/integration_tests.yml Fixed
Comment thread .github/workflows/integration_tests.yml Fixed
ionmincu and others added 2 commits May 14, 2026 10:53
The container image used by the integration-tests job
(ghcr.io/astral-sh/uv:python3.12-bookworm) does not put bash on the
default shell path, so GitHub falls back to `sh -e {0}` for inline
`run:` blocks. The Check secrets availability step uses bash array
syntax (`missing=()`), which is a POSIX-sh parse error and fails the
step before any check runs. Set shell: bash explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SonarCloud flagged the use of github.actor in the actor gate as
forgeable — on a re-run by a maintainer, github.actor becomes that
maintainer rather than the original PR author, which would let a
malicious PR bypass the gate. Switch to
github.event.pull_request.user.login, which is the immutable original
author set by GitHub from the authenticated session.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

3 participants