### Verify State Tracking Script Installation Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Verifies the successful installation of the state tracking script by running it with the 'get' command. ```powershell node (Join-Path $HOME ".feature-orchestrator" "state-utils.js") get ``` -------------------------------- ### Dockerfile Template Example Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md This is a template for generating Dockerfiles. It uses environment variables for configuration and includes setup for build essentials. Do not edit this file directly as it is generated. ```Dockerfile # # THIS IS A GENERATED-FILE. DO NOT EDIT DIRECTLY # FROM {{dockerBaseImage}} as BASE USER root ENV SDK_URL="{{androidCommandLineUtilsUrl}}" \ ANDROID_HOME="/usr/local/android-sdk" \ CMAKE_BIN_URL="{{cmakeBinUrl}}{{cmakeBinFile}}" \ CMAKE_TAR_FILE="{{cmakeBinFile}}" \ CMAKE_HOME="/usr/local/cmake" \ CMAKE_HOME_BIN="/usr/local/cmake/{{cmakeBinFolder}}/bin" \ NINJA_BIN_URL="{{ninjaBinUrl}}" \ NINJA_ZIP_FILE="{{ninjaZipFile}}" RUN apt-get update \ && apt-get -y install build-essential # Download Android SDK and Fix SDKManager for JDK 11 RUN mkdir "$ANDROID_HOME" .android \ && cd "$ANDROID_HOME" \ ``` -------------------------------- ### Manually Build and Install Feature Orchestrator Extension Source: https://github.com/azuread/android-complete/blob/master/extensions/feature-orchestrator/README.md Follow these steps to manually build and install the extension. This involves navigating to the extension directory, installing dependencies, compiling, packaging, and then installing the VSIX file. ```bash cd extensions/feature-orchestrator npm install npm run compile npx @vscode/vsce package --no-dependencies --allow-missing-repository --baseContentUrl . --baseImagesUrl . code --install-extension feature-orchestrator-latest.vsix --force ``` -------------------------------- ### Example Code Pattern Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/feature-planner/references/pbi-template.md Illustrates a code pattern to follow for implementation. This serves as a convention guide. ```plaintext // Example of the pattern to follow: class ExistingPattern { // show the convention } ``` -------------------------------- ### Generated Dockerfile Example Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md This is an example of a generated Dockerfile based on the provided template and parameters. It includes multiple build stages for different configurations, such as base, unit, and instrumented builds. ```Dockerfile # # THIS IS A GENERATED-FILE. DO NOT EDIT DIRECTLY # FROM gradle:6.7.1-jdk11 as BASE USER root ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \ ANDROID_HOME="/usr/local/android-sdk" \ Blah, blah... excluding for brevity FROM BASE as DBI_UNIT USER root ENV PATH="/usr/local/cmake/cmake-3.18.5-Linux-x86_64/bin:/usr/local/android-sdk/emulator:/usr/local/android-sdk/tools:/usr/local/android-sdk/tools/bin:/usr/local/android-sdk/platform-tools:${PATH}" \ ANDROID_HOME="/usr/local/android-sdk" \ ANDROID_VERSION=29 \ ANDROID_BUILD_TOOLS_VERSION=30.0.2 \ ANDROID_NDK_VERSION=ndk;21.1.6352462 # Install Android Build Tool and Libraries RUN $ANDROID_HOME/tools/bin/sdkmanager --update RUN touch /root/.android/repositories.cfg RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \ "platforms;android-${ANDROID_VERSION}" \ "platform-tools" \ "${ANDROID_NDK_VERSION}" \ "emulator" FROM DBI_UNIT as DBI_INSTRUMENTED USER root ENV ANDROID_HOME="/usr/local/android-sdk" \ SYSTEM_IMAGE="system-images;android-29;google_apis;x86_64" \ SYSTEM_IMAGE_TAG="google_apis" RUN apt-get -y install qt5-default RUN $ANDROID_HOME/tools/bin/sdkmanager "emulator" RUN yes | $ANDROID_HOME/tools/bin/sdkmanager $SYSTEM_IMAGE RUN echo no | $ANDROID_HOME/tools/bin/avdmanager create avd --force -g $SYSTEM_IMAGE_TAG -n test -k $SYSTEM_IMAGE ``` -------------------------------- ### Install Node.js LTS Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Provides installation commands for Node.js LTS on Windows and macOS. Node.js is a required tool for the orchestrator. ```powershell winget install OpenJS.NodeJS.LTS # Windows or brew install node # macOS or https://nodejs.org ``` -------------------------------- ### AI Orchestrator Setup Script Source: https://context7.com/azuread/android-complete/llms.txt Run the PowerShell setup script `setup-ai-orchestrator.ps1` to prepare your environment for AI-driven feature development. It checks and installs necessary tools like VS Code, GitHub Copilot, Node.js, GitHub CLI, and Azure CLI. ```powershell # Run the setup script .\scripts\setup-ai-orchestrator.ps1 # The script performs: # 1. Checks VS Code version (requires >= 1.109) # 2. Verifies GitHub Copilot extension # 3. Checks/installs Node.js # 4. Checks/installs GitHub CLI (gh) # 5. Authenticates GitHub accounts (public + EMU) # 6. Checks/installs Azure CLI with devops extension # 7. Clones design-docs repository # 8. Builds and installs Feature Orchestrator VS Code extension # 9. Creates state directory at ~/.android-auth-orchestrator/ # After setup, reload VS Code window: # Ctrl+Shift+P → "Reload Window" ``` -------------------------------- ### Install GitHub CLI on Windows Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pbi-dispatcher-github/SKILL.md Installs the GitHub CLI using Windows Package Manager if it's not found. ```powershell winget install --id GitHub.cli -e ``` -------------------------------- ### Install Azure CLI Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Provides installation commands for Azure CLI on Windows and macOS. Azure CLI is recommended for live PBI status updates. ```powershell winget install Microsoft.AzureCLI # Windows or brew install azure-cli # macOS ``` -------------------------------- ### Orchestrator Configuration Example Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pbi-dispatcher-github/SKILL.md Defines repository details and module-to-repo mappings for dispatching work items. 'host' should typically be 'github'. ```json // orchestrator-config.json (committed, shared): "repositories": { "common-repo": { "slug": "org/common-repo", "host": "github", "baseBranch": "main" }, "service-repo": { "slug": "enterprise-org/service-repo", "host": "github", "baseBranch": "dev" } }, "modules": { "core": { "repo": "common-repo" }, "service": { "repo": "service-repo" } } ``` -------------------------------- ### Install GitHub CLI on macOS Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pbi-dispatcher-github/SKILL.md Installs the GitHub CLI using Homebrew if it's not found. ```powershell brew install gh ``` -------------------------------- ### Install Feature Orchestrator Extension Source: https://github.com/azuread/android-complete/blob/master/extensions/feature-orchestrator/README.md Run this PowerShell script to build and install the extension automatically. Ensure you are in the repository root. ```powershell .\scripts\setup-ai-orchestrator.ps1 ``` -------------------------------- ### Local Installation Configuration Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/README.md Configure the VS Code settings.json to point to the local path of the feature-orchestrator-plugin for development. ```jsonc // In your VS Code settings.json: "chat.plugins.paths": { "/path/to/feature-orchestrator-plugin": true } ``` -------------------------------- ### Repository and Module Configuration Example Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/feature-planner/SKILL.md This JSON snippet illustrates the structure for configuring repositories and modules within the Feature Planner. It maps module names to specific repositories and defines repository details like slug and base branch. ```json // Example from config: "repositories": { "common-repo": { "slug": "org/common-repo", "baseBranch": "dev" }, "service-repo": { "slug": "org/service-repo", "baseBranch": "main" } }, "modules": { "core": { "repo": "common-repo", "path": "core/", "purpose": "Shared utilities" }, "service": { "repo": "service-repo", "purpose": "Backend processing" } } ``` -------------------------------- ### Verify GitHub CLI Installation Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pbi-dispatcher-github/SKILL.md Checks if the GitHub CLI is installed by displaying its version. This is the first step in ensuring prerequisites are met. ```powershell gh --version ``` -------------------------------- ### Install State Tracking Script Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Installs the state tracking script to a global location for managing feature progress across projects. Ensure the script is copied to `~/.feature-orchestrator/state-utils.js`. ```powershell $stateDir = Join-Path $HOME ".feature-orchestrator" if (-not (Test-Path $stateDir)) { New-Item -ItemType Directory -Path $stateDir -Force | Out-Null } # Find state-utils.js from the plugin installation $pluginStateUtils = Join-Path (Split-Path (Split-Path $PSScriptRoot)) "hooks" "state-utils.js" if (Test-Path $pluginStateUtils) { Copy-Item $pluginStateUtils (Join-Path $stateDir "state-utils.js") -Force } else { # Fallback: read the content from the plugin's hooks/state-utils.js and write it Write-Host "Please manually copy state-utils.js to $stateDir" } ``` -------------------------------- ### Example of Setting a Gradle Property Source: https://github.com/azuread/android-complete/blob/master/docs/ProjectBuild/gradle_project_properties.md This example demonstrates how to set the 'slice' project property when running a Gradle task. This property is passed to the 'common' module to direct ESTS requests to a specific slice. ```gradle ./gradlew msal:testLocalDebugUnitTest -Pslice= ``` -------------------------------- ### Check Prerequisites with Node.js, GitHub CLI, and Azure CLI Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Verify the installation of Node.js, GitHub CLI, and Azure CLI. Node.js is mandatory for state tracking. GitHub CLI is needed for GitHub repositories, and Azure CLI is optional for Azure DevOps work items. ```powershell node --version # Node.js (for state-utils) — REQUIRED gh --version # GitHub CLI — only needed if any repos are on GitHub az --version # Azure CLI — only needed if using ADO work items ``` -------------------------------- ### Dockerfile Parameters Example Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md This JSON file defines the parameters used to generate a Dockerfile. It specifies versions for Android SDK, build tools, NDK, and other dependencies like CMake and Ninja. ```json { "dockerBaseImage": "gradle:6.7.1-jdk11", "androidCommandLineUtilsUrl": "https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip", "androidApiLevel": "29", "androidBuildToolsVersion": "30.0.2", "androidNdkVersion": "ndk;21.1.6352462", "androidImageVariant": "google_apis", "androidImageAbi": "x86_64", "cmakeBinUrl": "https://github.com/Kitware/CMake/releases/download/v3.18.5/", "cmakeBinFile": "cmake-3.18.5-Linux-x86_64.tar.gz", "cmakeBinFolder": "cmake-3.18.5-Linux-x86_64", "ninjaBinUrl": "https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip", "ninjaZipFile": "ninja-linux.zip" } ``` -------------------------------- ### Login to GitHub CLI (Single Org) Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Guides the user to log in to GitHub CLI for a single organization context using a web-based flow. ```bash gh auth login --hostname github.com --git-protocol https --web ``` -------------------------------- ### Initialize Feature State Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/agents/feature-orchestrator.agent.md Starts tracking a new feature by adding it to the state with an initial step. The name and step should be provided in a JSON object. ```powershell node $su add-feature '{"name": "...", "step": "designing"}' ``` -------------------------------- ### Start Feature Design with Copilot Source: https://context7.com/azuread/android-complete/llms.txt Use this command to initiate a new feature by having Copilot research and create a design specification, including adding retry logic. ```markdown # Start a new feature - runs research + design spec creation /feature-design Add exponential backoff retry logic to IPC communication ``` -------------------------------- ### Initiate Feature Design Command Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/README.md Use this command in a chat to start the feature development pipeline by describing the desired feature. The plugin will then handle the design phase. ```bash /feature-orchestrator-plugin:feature-design I want to add retry logic with exponential backoff to the API client ``` -------------------------------- ### Run JVM Tests Source: https://github.com/azuread/android-complete/blob/master/docs/Automation/labsetup.md Execute JVM tests. If the certificate is installed on the machine, you can run tests without passing a specific build flag. ```bash ./gradlew :common:testLocalDebugUnitTest ``` -------------------------------- ### Generate LabApi Client using System Install Source: https://github.com/azuread/android-complete/blob/master/docs/ProjectBuild/swagger-codegen.md Command to generate Java client code for LabApi using a system-installed swagger-codegen. Ensure paths to swagger.json and config.json are correctly set. ```bash swagger-codegen generate -i ~/{path_to_common}/swagger.json -c ~/{path_to_common}/config.json -l java -o labapi ``` -------------------------------- ### Custom Git Alias for Droid Setup Source: https://github.com/azuread/android-complete/blob/master/README.md Execute this custom git command after setting up the local git configuration. It clones each required Android repository as a subfolder within your project. ```bash git droidSetup ``` -------------------------------- ### List Available VM OS Images Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md Find available virtual machine operating system images for a given location, offer, and SKU. Use '--all' to include all versions. ```bash az vm image list \ --location westus2 \ --offer ubuntu \ --sku 20.04 \ --all \ --query '[].urn' \ --output table ``` -------------------------------- ### List All Features with State Management Script Source: https://github.com/azuread/android-complete/blob/master/AI Driven Development Guide.md Use this Node.js command to list all features managed by the state utility. This is for reference and manual troubleshooting. ```powershell node .github/hooks/state-utils.js list-features ``` -------------------------------- ### List Azure CLI Extensions Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Lists all installed Azure CLI extensions and filters for the 'azure-devops' extension. If it's missing, you can install it using `az extension add --name azure-devops`. ```powershell az extension list -o json | ConvertFrom-Json | Where-Object { $_.name -eq "azure-devops" } ``` -------------------------------- ### Get Feature Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/feature-continue.md Retrieves the state of a specific feature by its name. Replace "" with the actual feature name. ```bash node $su get-feature "" ``` -------------------------------- ### Launch Auth Tab Intent Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/feature-planner/SKILL.md Launches the AuthTabIntent using a provided launcher, URI, and redirect scheme. This method requires three parameters: the launcher, the URI, and the redirectScheme. ```kotlin fun launch(launcher: ActivityResultLauncher, uri: Uri, redirectScheme: String) { AuthTabIntent.Builder().build().launch(launcher, uri, redirectScheme) } ``` -------------------------------- ### Add Tests for HttpClient Retry Logic Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/feature-planner/SKILL.md Example of creating a new test class for HttpClient to cover the added retry logic. ```java // new test class ``` -------------------------------- ### Azure CLI for VM Provisioning Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md Commands to log in to Azure CLI and set the active subscription for provisioning Azure resources. ```bash # login into azure cli az login # Note please change subscription to the subscription in which you want to act.. the default is correct for me, but likely not for you! ``` -------------------------------- ### Add RETRY_ENABLED Flag to CommonFlight Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/feature-planner/SKILL.md Example of adding a RETRY_ENABLED flag to the CommonFlight class. This is typically done to control retry behavior. ```java // add RETRY_ENABLED flag ``` -------------------------------- ### Check Azure CLI Version Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Verifies if the Azure CLI is installed and its version. This is a prerequisite for using Azure DevOps features via the CLI. ```powershell az --version ``` -------------------------------- ### Present Action Options with askQuestion Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/feature-pr-iterate.md Utilize the `askQuestion` function to present a set of options to the user for handling a pull request. Each option has a label and a description of its action. ```javascript askQuestion({ question: "How would you like to handle this PR?", options: [ { label: "🤖 Delegate to Copilot", description: "Post @copilot comment with feedback" }, { label: "📋 Analyze comments", description: "Show review comments with proposed resolutions" }, { label: "✅ Approve", description: "Approve the PR" }, { label: "🔄 Request changes", description: "Request specific changes" } ] }) ``` -------------------------------- ### Present Design Choices using askQuestion Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/design-author/SKILL.md This JavaScript snippet demonstrates how to present a user with a set of options after a design spec has been written. It's crucial to wait for the developer's explicit choice before proceeding. ```javascript askQuestion({ question: "Design spec written. What would you like to do?", options: [ { label: "📖 Review locally", description: "Open in editor for inline review" }, { label: "✅ Approve & plan PBIs", description: "Skip PR, move to work item planning" }, { label: "📋 Open draft PR", description: "Push to review repo as draft PR" }, { label: "🚀 Open published PR", description: "Push and publish PR for team review" }, { label: "✏️ Request changes", description: "Tell me what to revise" } ] }) ``` -------------------------------- ### Developer-Local GitHub Accounts Configuration Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Example of the `developer-local.json` file structure for mapping GitHub repositories to specific user accounts. This file is gitignored. ```json { "github_accounts": { "org/common-repo": "johndoe", "org/service-repo": "johndoe_microsoft", "other-org/client-repo": "johndoe-alt" } } ``` -------------------------------- ### Run Unit Tests from Command Line Source: https://github.com/azuread/android-complete/blob/master/docs/Automation/how_to_run_tests.md Execute unit tests for a specific module using Gradle. Ensure the module name and test command are correctly specified. ```bash ./gradlew msal:testLocalDebugUnitTest ``` -------------------------------- ### Get GitHub Authentication Status Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pbi-dispatcher-github/SKILL.md Retrieves the current authentication status of the GitHub CLI. Output is redirected to standard error to capture all messages. ```powershell $ghStatus = gh auth status 2>&1 ``` -------------------------------- ### Shared Orchestrator GitHub Configuration Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Example of the shared `orchestrator-config.json` file, specifying the path to the developer-local configuration for GitHub accounts. Usernames are excluded from this file. ```json "github": { "configFile": ".github/developer-local.json" } ``` -------------------------------- ### Initialize Git Workspace Source: https://context7.com/azuread/android-complete/llms.txt Use this command to clone all necessary repositories and configure the local workspace for multi-repository development. It sets up the .gitconfig for unified management. ```bash # Initial setup - clone all repositories and configure the workspace git config --local include.path ../.gitconfig git droidSetup ``` -------------------------------- ### Update HttpClient with Retry Logic Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/feature-planner/SKILL.md Example of adding retry logic to the HttpClient. This involves modifying the HttpClient class and potentially adding a new flag to CommonFlight. ```java // add retry logic ``` -------------------------------- ### AskQuestion for PBI Plan Review Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/agents/feature-orchestrator.agent.md After the PBI plan is ready, use this askQuestion function to prompt the user for the next step, offering options to create PBIs in Azure DevOps or revise the plan. ```javascript askQuestion({ question: "PBI plan is ready for review. What next?", options: [ { label: "✅ Backlog in ADO", description: "Create these PBIs as work items in Azure DevOps" }, { label: "✏️ Revise Plan", description: "Adjust the PBI breakdown before creating" } ] }) ``` -------------------------------- ### Get Full Feature Details with State Management Script Source: https://github.com/azuread/android-complete/blob/master/AI Driven Development Guide.md Retrieve detailed information for a specific feature using this Node.js command. Useful for manual troubleshooting. ```powershell node .github/hooks/state-utils.js get-feature \"\" ``` -------------------------------- ### Basic Plugin Implementation in Java Source: https://github.com/azuread/android-complete/blob/master/plugins/buildsystem/docs/Overview.md This Java code snippet shows the basic structure for implementing a Gradle plugin by overriding the 'apply' method. It receives a reference to the Project object. ```java @Override public void apply(final Project project) { } ``` -------------------------------- ### Build Docker Image for DBI Instrumented Target Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md Use this command to build a Docker image for the DBI_INSTRUMENTED target. Ensure you are in the folder containing the API level Dockerfile. The period indicates the current directory. ```bash # In the folder containing the api level Dockerfile... don't forget the period to indicate use the dockerfile from this directory docker build --target DBI_INSTRUMENTED -t dbi-instrumented-api29 . ``` -------------------------------- ### Create Azure Virtual Machine Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md Provision a new Azure virtual machine with specified name, resource group, size, and OS image. This command also generates SSH keys for access. ```bash $ ./az vm create \ --name androidagent1 \ --resource-group androidbuildagents \ --size Standard_D4_v3 \ --image Canonical:UbuntuServer:18.04-LTS:latest \ --generate-ssh-keys \ --admin-username android \ --storage-sku Standard_LRS ``` -------------------------------- ### Generated JaCoCoReport Task Names Source: https://github.com/azuread/android-complete/blob/master/plugins/buildsystem/docs/CodeCoverage.md Example task names generated by the plugin for each variant, following the pattern `{flavor}{build type}{project}{test type}CoverageReport`. ```text distDebugAppAndroidTestCoverageReport distDebugAppUnitTestCoverageReport localDebugAppAndroidTestCoverageReport localDebugAppUnitTestCoverageReport ``` -------------------------------- ### List Gradle Tasks for Automation Apps Source: https://github.com/azuread/android-complete/blob/master/docs/Automation/how_to_run_tests.md View available automation tasks for MSAL and Broker apps by running Gradle commands. This helps in understanding the available automation configurations. ```bash ./gradlew msalautomationapp:tasks ``` ```bash ./gradlew brokerautomationapp:tasks ``` -------------------------------- ### Get Git Remote URL for Workspace Root Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md Retrieves the 'origin' remote URL for the main workspace directory. This command is used in conjunction with subdirectory checks to discover all project repositories. ```powershell git remote get-url origin ``` -------------------------------- ### Get PR Diff Statistics with GitHub CLI Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pr-validator/SKILL.md This command retrieves the diff statistics for a pull request, showing additions and deletions. It's useful for understanding the scope of changes in a PR. ```powershell gh pr diff --repo "" --stat ``` -------------------------------- ### Script for Running Instrumented Tests Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md This bash script is executed within the Docker container to start the ADB daemon, launch the Android emulator, and run instrumented tests using Gradle. ```bash #!/bin/bash echo ============================================= echo Starting ADB Daemon echo ============================================= adb start-server echo ============================================= echo Starting Emulator echo ============================================= emulator @test -no-window -no-audio -wipe-data & echo ============================================= echo Gradle Version Info echo ============================================= gradle -version echo ============================================= echo Running instrumented tests echo ============================================= gradle common:connectedDebugAndroidTest -i ``` -------------------------------- ### Run Android UI Automation Tests Source: https://github.com/azuread/android-complete/blob/master/docs/Automation/labsetup.md Execute UI automation tests on an Android device. Ensure the certificate PFX file is pushed to the device before running. ```bash ./gradlew msalautomationapp:connectedLocalBrokerHostDebugAndroidTest -PlabSecret="" ``` -------------------------------- ### View GitHub Pull Request Details Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/feature-status.md Use the GitHub CLI to view detailed information about a pull request, including its state, title, and status checks. Ensure you have the GitHub CLI installed and authenticated. ```powershell gh pr view --repo "" --json state,title,url,statusCheckRollup,additions,deletions,changedFiles,isDraft ``` -------------------------------- ### List All Docker Containers (Running or Stopped) Source: https://github.com/azuread/android-complete/blob/master/docker/overview.md Lists all Docker containers, including those that are stopped. Stopped containers consume disk space and should be managed. ```bash #list all containers running or not. These take up diskspace! docker container ls -a ``` -------------------------------- ### Manage Feature State with State Utils Source: https://github.com/azuread/android-complete/blob/master/AI Driven Development Guide.md Use these Node.js commands to manage feature states, including setting design approval, adding Product Backlog Items (PBIs), and adding agent pull requests. Ensure the feature name is correctly specified. ```bash node .github/hooks/state-utils.js set-design "" '{"docPath":"...","status":"approved"}' ``` ```bash node .github/hooks/state-utils.js add-pbi "" '{"adoId":123,"title":"...","module":"common","status":"Committed"}' ``` ```bash node .github/hooks/state-utils.js add-agent-pr "" '{"repo":"common","prNumber":123,"prUrl":"...","status":"open"}' ``` -------------------------------- ### Resume Pipeline Step with Copilot Source: https://context7.com/azuread/android-complete/llms.txt Resume the development pipeline from the current step using this Copilot command. ```markdown # Resume from current pipeline step /feature-continue ``` -------------------------------- ### Feature Orchestrator State Management CLI Commands Source: https://context7.com/azuread/android-complete/llms.txt Utilize the `state-utils.js` Node.js script to manage feature development state for AI agents. Commands include listing, getting details, creating, updating steps, and adding artifacts like PBIs and PRs for features. ```bash # List all tracked features node .github/hooks/state-utils.js list-features # Output: [{"id":"feature-123","name":"IPC Retry","step":"designing","pbis":3,"prs":1}] ``` ```bash # Get full details for a specific feature node .github/hooks/state-utils.js get-feature "IPC Retry with Exponential Backoff" # Returns complete feature object with artifacts, timeline, etc. ``` ```bash # Create a new feature node .github/hooks/state-utils.js add-feature '{"name": "My New Feature", "step": "designing"}' # Output: {"ok": true, "id": "feature-1234567890-abc"} ``` ```bash # Update feature step/phase node .github/hooks/state-utils.js set-step "My Feature" "plan_review" # Valid steps: idle, designing, design_review, planning, plan_review, # backlogging, backlog_review, dispatching, monitoring, done ``` ```bash # Set design artifact node .github/hooks/state-utils.js set-design "My Feature" '{"docPath":"design-docs/[Android] My Feature/spec.md","status":"approved"}' ``` ```bash # Add a PBI (Product Backlog Item) node .github/hooks/state-utils.js add-pbi "My Feature" '{"adoId":12345,"title":"Implement retry logic","module":"common","status":"Committed","dependsOn":[]}' ``` ```bash # Add an agent PR node .github/hooks/state-utils.js add-agent-pr "My Feature" '{"repo":"common","prNumber":2916,"prUrl":"https://github.com/AzureAD/microsoft-authentication-library-common-for-android/pull/2916","status":"open"}' ``` ```bash # Add timeline event node .github/hooks/state-utils.js add-timeline "My Feature" '{"agent":"design-writer","action":"Created design spec","phase":"designing"}' ``` -------------------------------- ### Supply Gradle Project Properties via Command Line Source: https://github.com/azuread/android-complete/blob/master/docs/ProjectBuild/gradle_project_properties.md Use this syntax to pass custom parameters to a Gradle task. Replace `` with the Gradle task name and `=` with your desired property. ```bash ./gradlew -P= ``` -------------------------------- ### Login to GitHub CLI Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/pbi-dispatcher-github/SKILL.md Logs the user into the GitHub CLI for the default GitHub.com hostname. This is a fallback if no other authentication method is found. ```powershell gh auth login --hostname github.com ``` -------------------------------- ### Present Work Item Plan with askQuestion Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/feature-plan.md Use `askQuestion` to present the decomposed work item plan and offer options for the next steps, such as creating work items in Azure DevOps or revising the plan. ```typescript askQuestion({ question: "Work item plan is ready. What next?", options: [ { label: "✅ Create in ADO", description: "Create work items in Azure DevOps" }, { label: "✏️ Revise plan", description: "Adjust the breakdown first" } ] }) ``` -------------------------------- ### Run Broker Release Automation Locally Source: https://github.com/azuread/android-complete/blob/master/docs/Automation/release_automation_scripts.md Execute the Broker Release Automation script locally. Requires labSecret, authenticatorApkPath, and companyPortalApkPath as arguments. ```powershell .\BrokerReleaseAutomation.ps1 -labSecret -authenticatorApkPath '' -companyPortalApkPath '' ``` -------------------------------- ### List Branches Source: https://context7.com/azuread/android-complete/llms.txt Lists all branches in all repositories within the workspace. ```bash # List branches in all repos git droidBranch ``` -------------------------------- ### Search for Designs using Bash Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/skills/design-author/SKILL.md Use this bash command to search for existing design documents within a specified path, matching a given keyword. This helps in referencing existing styles and historical context. ```bash ls / | grep -i "" ``` -------------------------------- ### Initialize Monthly Release Source: https://context7.com/azuread/android-complete/llms.txt Initializes a new monthly release by setting RC (Release Candidate) versions for MSAL, Broker, Common, and related libraries. It also updates changelogs, versioning files, and Gradle build files. ```powershell # Initialize a monthly release with version numbers for all libraries . scripts\release\init_release.ps1 ` -msalVersion "5.0.0" ` -brokerVersion "6.0.0" ` -CommonVersion "15.0.0" ` -Common4jVersion "1.0.0" ` -broker4jVersion "1.0.0" ``` -------------------------------- ### Map GitHub Accounts to Repositories (Multiple Accounts) Source: https://github.com/azuread/android-complete/blob/master/feature-orchestrator-plugin/commands/setup.md An interactive prompt to assign a specific GitHub account to each repository when multiple accounts are available. Includes repository slug for clarity. ```javascript askQuestion({ questions: [ { header: "Account for: microsoft/VerifiableCredential-SDK-Android", question: "Which GitHub account should be used for microsoft/VerifiableCredential-SDK-Android?", options: [ { label: "johndoe", description: "github.com" }, { label: "johndoe_microsoft", description: "github.com (EMU)" } ] }, { header: "Account for: microsoft/entra-verifiedid-wallet-library-android", question: "Which GitHub account should be used for microsoft/entra-verifiedid-wallet-library-android?", options: [ { label: "johndoe", description: "github.com" }, { label: "johndoe_microsoft", description: "github.com (EMU)" } ] } ] }) ```