Skip to content

[CI][Feature]: Add deterministic native CodeQL scanning - #754

Open
kieran-osgood-shopify wants to merge 2 commits into
e2e-requiredfrom
codeql
Open

kieran-osgood-shopify wants to merge 2 commits into
e2e-requiredfrom
codeql

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

TLDR

Enable CodeQL on all languages we utilise
CodeQL has been silently failing for a while despite showing green on PR's

image

How

This uses CodeQL Advanced setup with the security-extended query suite and explicit production-only extraction:

  • Actions, JavaScript/TypeScript, and Ruby use buildless analysis.
  • Android SDK/protocol and React Native Android compile into separate Java/Kotlin databases.
  • Core Swift and React Native iOS compile into separate Swift databases.
  • Native SARIF is allowlisted to shipped source roots, excluding tests, samples, dependencies, and generated build output.
  • Native change detection avoids unrelated platform builds while the workflow still runs on every ready PR, ensuring GitHub's aggregate CodeQL status always materializes.

A normal traced xcodebuild contained all 93 production Swift files but omitted executable control-flow and data-flow bodies for most Swift package dependency methods. The core Swift job therefore:

  1. builds the real package and generated resource accessors before CodeQL initialization;
  2. emits importable dependency modules in package order outside tracing; and
  3. traces exactly one focused swiftc -typecheck pass for each production module after initialization.

React Native iOS separately type-checks the six shipped wrapper sources against the published Shopify SDK and a minimal React declaration shim. This preserves real SDK type checking without tracing React Native's full CocoaPods dependency graph.

Future

We might want to explore whether there is better tooling available to Shopify for native applications, this has proved painful to setup and took an agent half a day of churn to setup

How to test

GIVEN the current-head CodeQL workflow run is complete

WHEN the reviewer opens https://github.com/Shopify/checkout-kit/actions/runs/34612331981

THEN Actions, JavaScript/TypeScript, Ruby, Android, React Native Android, Swift, and React Native iOS analysis should all be green

AND the GitHub Advanced Security aggregate CodeQL check should be green


GIVEN disposable canary PR #760 exercised every analysis path and is closed

WHEN the reviewer opens https://github.com/Shopify/checkout-kit/security/code-scanning/10

THEN CodeQL should show swift/unsafe-webview-fetch at platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift:1142 from the canary ref

AND no canary source should exist in either mergeable branch

Verification

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 9, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the codeql branch 5 times, most recently from 3819166 to aea223d Compare September 9, 2026 17:01
@kieran-osgood-shopify
kieran-osgood-shopify marked this pull request as ready for review September 9, 2026 17:24
@kieran-osgood-shopify
kieran-osgood-shopify requested a review from a team as a code owner September 9, 2026 17:24
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the codeql branch 2 times, most recently from 81ffc56 to c377280 Compare September 10, 2026 10:27
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from main to e2e-required September 10, 2026 10:27
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #759 September 10, 2026 10:27
@bitrise

bitrise Bot commented Sep 10, 2026

Copy link
Copy Markdown

Checkout Kit E2E results

No E2E tests to run for this change.

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the codeql branch 2 times, most recently from fa8cc80 to c8ca293 Compare September 10, 2026 15:54
@kieran-osgood-shopify
kieran-osgood-shopify removed this pull request from stack #759 September 10, 2026 17:01
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #762 September 10, 2026 17:02
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the codeql branch 2 times, most recently from 80afb63 to 88013a7 Compare September 10, 2026 17:03
@kieran-osgood-shopify kieran-osgood-shopify changed the title Add deterministic native CodeQL scanning [CI][Feature]: Add deterministic native CodeQL scanning Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants