|
| 1 | +# GitHub Copilot Instructions for Azure-Sentinel Repository |
| 2 | + |
| 3 | +## Solutions Analyzer Tools |
| 4 | + |
| 5 | +When working with the Solutions Analyzer tools in `Tools/Solutions Analyzer/`: |
| 6 | + |
| 7 | +### Output Locations |
| 8 | + |
| 9 | +There are THREE different output scenarios - **never confuse them**: |
| 10 | + |
| 11 | +1. **Default (development):** CSVs are written to `Tools/Solutions Analyzer/` in the current branch |
| 12 | + - This is the normal case when developing/testing |
| 13 | + - **Never generate documentation here** |
| 14 | + |
| 15 | +2. **Output worktree (publishing CSVs):** `C:\Users\ofshezaf\GitHub\Azure-Sentinel-solution-analyzer-output\Tools\Solutions Analyzer` |
| 16 | + - Only use this when **specifically requested** to "publish CSVs to the output branch" |
| 17 | + - This is a separate git worktree for the CSV output branch |
| 18 | + - **Only CSVs go here, never documentation** |
| 19 | + |
| 20 | +3. **Documentation output:** `C:\Users\ofshezaf\GitHub\sentinelninja\Solutions Docs` |
| 21 | + - This is where generated markdown documentation goes |
| 22 | + - This is in a **separate repository** (sentinelninja) |
| 23 | + - Empty the target folder before generating new docs |
| 24 | + |
| 25 | +### Key Rules |
| 26 | + |
| 27 | +- **Never generate docs locally** in the Azure-Sentinel repository |
| 28 | +- **Generate docs only in the sentinelninja repo** when asked or needed |
| 29 | +- **For official CSV releases**, generate CSVs **only** in the solution analyzer output worktree |
| 30 | +- Always use `--output-dir` flag when running `generate_connector_docs.py` |
| 31 | + |
| 32 | +### Running Scripts |
| 33 | + |
| 34 | +#### Mapper Script |
| 35 | +```powershell |
| 36 | +cd "Tools/Solutions Analyzer" |
| 37 | +python map_solutions_connectors_tables.py |
| 38 | +``` |
| 39 | + |
| 40 | +**Note:** Do NOT truncate or filter the output (e.g., do not pipe through `Select-Object`). The script prints timestamped progress messages to the console that the user needs to see. Run with `isBackground: false` and `timeout: 0` so the full output is visible. |
| 41 | + |
| 42 | +#### Documentation Generator |
| 43 | +```powershell |
| 44 | +python generate_connector_docs.py --output-dir "C:\Users\ofshezaf\GitHub\sentinelninja\Solutions Docs" --skip-input-generation |
| 45 | +``` |
| 46 | + |
| 47 | +**IMPORTANT:** Never run without `--output-dir` flag. |
| 48 | + |
| 49 | +**IMPORTANT:** Do NOT truncate or filter the output (e.g., do not pipe through `Select-Object`). Run with `isBackground: false` and `timeout: 0` so the full output is visible to the user. |
| 50 | + |
| 51 | +**IMPORTANT:** Always use `--skip-input-generation` unless you specifically need to regenerate the input CSVs (mapper + collect_table_info). Without this flag, the doc generator will re-run those scripts automatically, which is slow and unnecessary if the CSVs are already up-to-date. |
| 52 | + |
| 53 | +**IMPORTANT:** Run the mapper script before generating docs if: |
| 54 | +- The mapper script itself was modified, OR |
| 55 | +- Any override YAML file in the `overrides/` folder was modified (including adding, editing, or removing `additional_connectors` entries), OR |
| 56 | +- You specifically need to refresh the CSV data, OR |
| 57 | +- You are explicitly asked to run the mapper |
| 58 | + |
| 59 | +### Caching and Logging |
| 60 | + |
| 61 | +- **Cache:** `.cache/` folder for analysis caching |
| 62 | +- **Logs:** `.logs/` folder for log files |
| 63 | + |
| 64 | +**Log file:** `Tools/Solutions Analyzer/.logs/map_solutions_connectors_tables.log` |
| 65 | + |
| 66 | +Use `--force-refresh` with these types when modifying analysis logic: |
| 67 | +- `asim` - ASIM parser analysis |
| 68 | +- `parsers` - Non-ASIM parser analysis |
| 69 | +- `solutions` - Solution content analysis |
| 70 | +- `standalone` - Standalone content item analysis |
| 71 | +- `marketplace` - Marketplace availability check (requires network) |
| 72 | +- `tables` - Table reference info (requires network) |
| 73 | + |
| 74 | +### Script Documentation |
| 75 | + |
| 76 | +**Before updating a script:** Always review the relevant script documentation in `Tools/Solutions Analyzer/docs/` first. |
| 77 | + |
| 78 | +**When updating a script**, update the corresponding script doc to reflect: |
| 79 | +- Any script parameters added or changed |
| 80 | +- Any output file changes, including changes to CSV files (new columns, renamed columns, removed columns) |
| 81 | +- Any changes to analysis methods or logic |
| 82 | +- Update the primary readme.md if needed and add the change to the change log. Do not add a version if the previous version as manifested by the changelog, was not committed yet. |
0 commit comments