Skip to content

Add --domain option to analyze.sh for domain-specific analysis#551

Merged
JohT merged 2 commits intomainfrom
feature/selectable-domain
Mar 31, 2026
Merged

Add --domain option to analyze.sh for domain-specific analysis#551
JohT merged 2 commits intomainfrom
feature/selectable-domain

Conversation

@JohT
Copy link
Copy Markdown
Owner

@JohT JohT commented Mar 30, 2026

🚀 Feature

  • Add --domain option to analyze.sh for domain-specific analysis:

    Now you can use --domain to run analysis for a single domain (vertical slice), skipping core reports and other domains. This enables focused, domain-specific analysis that's faster and more resource-efficient. The option works with --report to further narrow the scope (e.g. --domain anomaly-detection --report Csv), and is available in both the CLI and GitHub Actions workflow.

⚙️ Optimization

@JohT JohT self-assigned this Mar 30, 2026
@JohT JohT requested a review from Copilot March 30, 2026 16:33
Copy link
Copy Markdown
Contributor

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

Adds a --domain option to scripts/analysis/analyze.sh to support running a domain-specific (vertical-slice) analysis, and updates report compilation scripts, documentation, and the public workflow to support/describe domain-scoped execution.

Changes:

  • Add --domain <domain-name> parsing + validation in analyze.sh, exposing the selected domain via ANALYSIS_DOMAIN.
  • Update report compilation scripts to run only the selected domain’s reports when ANALYSIS_DOMAIN is set (and skip Jupyter reports).
  • Add docs/examples and a GitHub Actions workflow input to run domain-scoped analysis in CI.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
scripts/analysis/analyze.sh Adds --domain option, validates domain name and existence, sets ANALYSIS_DOMAIN
scripts/reports/compilations/CsvReports.sh Filters report discovery based on ANALYSIS_DOMAIN
scripts/reports/compilations/PythonReports.sh Filters report discovery based on ANALYSIS_DOMAIN
scripts/reports/compilations/MarkdownReports.sh Filters report discovery based on ANALYSIS_DOMAIN
scripts/reports/compilations/VisualizationReports.sh Filters report discovery based on ANALYSIS_DOMAIN
scripts/reports/compilations/JupyterReports.sh Skips notebook reports when ANALYSIS_DOMAIN is set
scripts/testAnalyzeDomainOption.sh Adds a new shell test for --domain behavior
GETTING_STARTED.md Documents --domain usage examples
COMMANDS.md Documents --domain behavior and examples
.github/workflows/public-analyze-code-graph.yml Adds domain input and passes it to analyze.sh
Comments suppressed due to low confidence (2)

scripts/analysis/analyze.sh:89

  • Argument parsing double-shifts for flag-style options like --explore: the --explore) case calls shift, and then the loop unconditionally shifts again at the end. If --explore is not the last argument (e.g. --explore --profile Default), the second shift will skip the next option and break parsing. Consider shifting exactly once per consumed token (e.g. shift 1 for flags, shift 2 for options with values) and removing the unconditional trailing shift.
# Parse command line arguments
while [[ $# -gt 0 ]]; do
  key="$1"
  case $key in
    --report)
      analysisReportCompilation="$2"
      shift
      ;;
    --profile)
      settingsProfile="$2"
      shift
      ;;
    --explore)
      exploreMode=true
      shift
      ;;
    --domain)
      selectedAnalysisDomain="$2"
      shift
      ;;
    *)
      echo "analyze: Error: Unknown option: ${key}"
      usage
      ;;
  esac
  shift || true # ignore error when there are no more arguments
done

scripts/reports/compilations/PythonReports.sh:58

  • The error message refers to DOMAIN_DIRECTORY, but the actual variable used/configurable in this script is DOMAINS_DIRECTORY. Align the wording so users know which env var to set.
for directory in "${analysisReportScriptDirectories[@]}"; do
    if [ ! -d "${directory}" ]; then
        echo "${SCRIPT_NAME}: Error: Directory ${directory} does not exist. Please check your REPORTS_SCRIPT_DIR and DOMAIN_DIRECTORY settings."
        exit 1
    fi

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

Comment thread scripts/testAnalyzeDomainOption.sh Outdated
Comment thread scripts/reports/compilations/VisualizationReports.sh Outdated
Comment thread scripts/reports/compilations/CsvReports.sh Outdated
Comment thread .github/workflows/public-analyze-code-graph.yml Outdated
Comment thread scripts/analysis/analyze.sh
Comment thread scripts/analysis/analyze.sh Outdated
Comment thread scripts/testAnalyzeDomainOption.sh Outdated
Comment thread scripts/reports/compilations/MarkdownReports.sh Outdated
@JohT JohT force-pushed the feature/selectable-domain branch from 315ab2b to edca27b Compare March 30, 2026 18:44
@JohT JohT marked this pull request as ready for review March 30, 2026 18:49
@JohT JohT force-pushed the feature/selectable-domain branch from edca27b to a5c67a9 Compare March 31, 2026 05:56
@JohT JohT merged commit c7775d7 into main Mar 31, 2026
10 checks passed
@JohT JohT deleted the feature/selectable-domain branch March 31, 2026 06:18
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