Add --domain option to analyze.sh for domain-specific analysis#551
Merged
Add --domain option to analyze.sh for domain-specific analysis#551
--domain option to analyze.sh for domain-specific analysis#551Conversation
Contributor
There was a problem hiding this comment.
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 inanalyze.sh, exposing the selected domain viaANALYSIS_DOMAIN. - Update report compilation scripts to run only the selected domain’s reports when
ANALYSIS_DOMAINis 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 callsshift, and then the loop unconditionally shifts again at the end. If--exploreis 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 1for flags,shift 2for options with values) and removing the unconditional trailingshift.
# 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 isDOMAINS_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.
315ab2b to
edca27b
Compare
edca27b to
a5c67a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 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