diff --git a/.github/workflows/internal-check-links-in-documentation.yml b/.github/workflows/internal-check-links-in-documentation.yml index b48cf2a12..e5ec09940 100644 --- a/.github/workflows/internal-check-links-in-documentation.yml +++ b/.github/workflows/internal-check-links-in-documentation.yml @@ -10,7 +10,7 @@ on: - 'COMMANDS.md' - 'GETTING_STARTED.md' - 'INTEGRATION.md' - - '.github/workflows/check-links-in-documentation.yml' # also run when this file was changed + - '.github/workflows/internal-check-links-in-documentation.yml' # also run when this file was changed schedule: - cron: "15 6 1 * *" # On the first day of each month at 6:15 o'clock diff --git a/.github/workflows/internal-check-renovate-config.yml b/.github/workflows/internal-check-renovate-config.yml index bd4e37d0e..8c87ee18c 100644 --- a/.github/workflows/internal-check-renovate-config.yml +++ b/.github/workflows/internal-check-renovate-config.yml @@ -7,6 +7,7 @@ on: # Only watch root level Renovate configuration changes paths: - 'renovate.json*' + - '.github/workflows/internal-check-renovate-config.yml' # or when this file changed jobs: reports: diff --git a/.github/workflows/internal-cypher-reference-documentation.yml b/.github/workflows/internal-cypher-reference-documentation.yml index 3f57346a8..e97ec6c20 100644 --- a/.github/workflows/internal-cypher-reference-documentation.yml +++ b/.github/workflows/internal-cypher-reference-documentation.yml @@ -6,13 +6,13 @@ on: - main paths: - '**/*.cypher' # Only run when cypher files changed - - '.github/workflows/cypher-reference-documentation.yml' # or when this file was changed + - '.github/workflows/internal-cypher-reference-documentation.yml' # or when this file was changed pull_request: branches: - main paths: - '**/*.cypher' # Only run when cypher files changed - - '.github/workflows/cypher-reference-documentation.yml' # or when this file was changed + - '.github/workflows/internal-cypher-reference-documentation.yml' # or when this file was changed jobs: reports: diff --git a/.github/workflows/internal-environment-variables-reference-documentation.yml b/.github/workflows/internal-environment-variables-reference-documentation.yml index 13ea59ea0..f005f2c71 100644 --- a/.github/workflows/internal-environment-variables-reference-documentation.yml +++ b/.github/workflows/internal-environment-variables-reference-documentation.yml @@ -6,13 +6,13 @@ on: - main paths: - '**/*.sh' # Only run when script files changed - - '.github/workflows/environment-variables-reference-documentation.yml' # or when this file was changed + - '.github/workflows/environment-internal-variables-reference-documentation.yml' # or when this file was changed pull_request: branches: - main paths: - '**/*.sh' # Only run when script files changed - - '.github/workflows/environment-variables-reference-documentation.yml' # or when this file was changed + - '.github/workflows/environment-internal-variables-reference-documentation.yml' # or when this file was changed jobs: reports: diff --git a/.github/workflows/internal-java-code-analysis.yml b/.github/workflows/internal-java-code-analysis.yml index 9930a32a1..71c9e571a 100644 --- a/.github/workflows/internal-java-code-analysis.yml +++ b/.github/workflows/internal-java-code-analysis.yml @@ -17,7 +17,7 @@ on: - 'renovate.json' - 'changelogTemplate.mustache' - '**.code-workspace' - - '.github/workflows/typescript-code-analysis.yml' + - '.github/workflows/internal-typescript-code-analysis.yml' - '.github/workflows/*documentation.yml' pull_request: branches: @@ -35,7 +35,7 @@ on: - 'renovate.json' - 'changelogTemplate.mustache' - '**.code-workspace' - - '.github/workflows/typescript-code-analysis.yml' + - '.github/workflows/internal-typescript-code-analysis.yml' - '.github/workflows/*documentation.yml' # Requires the secret NEO4J_INITIAL_PASSWORD to be configured diff --git a/.github/workflows/internal-report-reference-documentation.yml b/.github/workflows/internal-report-reference-documentation.yml index 42735a470..146348126 100644 --- a/.github/workflows/internal-report-reference-documentation.yml +++ b/.github/workflows/internal-report-reference-documentation.yml @@ -7,14 +7,14 @@ on: paths: - 'results/**' # Only run results have been updates - '!results/*.md' # Ignore when report reference documentation itself changes - - '.github/workflows/report-reference-documentation.yml' # or when this file was changed + - '.github/workflows/internal-report-reference-documentation.yml' # or when this file was changed pull_request: branches: - main paths: - 'results/**' # Only run results have been updates - '!results/*.md' # Ignore when report reference documentation itself changes - - '.github/workflows/report-reference-documentation.yml' # or when this file was changed + - '.github/workflows/internal-report-reference-documentation.yml' # or when this file was changed jobs: reports: diff --git a/.github/workflows/internal-scripts-reference-documentation.yml b/.github/workflows/internal-scripts-reference-documentation.yml index f2b896940..918dd82d6 100644 --- a/.github/workflows/internal-scripts-reference-documentation.yml +++ b/.github/workflows/internal-scripts-reference-documentation.yml @@ -6,13 +6,13 @@ on: - main paths: - '**/*.sh' # Only run when script files changed - - '.github/workflows/scripts-reference-documentation.yml' # or when this file was changed + - '.github/workflows/internal-scripts-reference-documentation.yml' # or when this file was changed pull_request: branches: - main paths: - '**/*.sh' # Only run when script files changed - - '.github/workflows/scripts-reference-documentation.yml' # or when this file was changed + - '.github/workflows/internal-scripts-reference-documentation.yml' # or when this file was changed jobs: reports: diff --git a/.github/workflows/internal-typescript-code-analysis.yml b/.github/workflows/internal-typescript-code-analysis.yml index 2e175916f..a2bc5c919 100644 --- a/.github/workflows/internal-typescript-code-analysis.yml +++ b/.github/workflows/internal-typescript-code-analysis.yml @@ -17,7 +17,7 @@ on: - 'renovate.json' - 'changelogTemplate.mustache' - '**.code-workspace' - - '.github/workflows/java-code-analysis.yml' + - '.github/workflows/internal-java-code-analysis.yml' - '.github/workflows/*documentation.yml' pull_request: branches: @@ -35,7 +35,7 @@ on: - 'renovate.json' - 'changelogTemplate.mustache' - '**.code-workspace' - - '.github/workflows/java-code-analysis.yml' + - '.github/workflows/internal-java-code-analysis.yml' - '.github/workflows/*documentation.yml' jobs: @@ -106,6 +106,7 @@ jobs: with: name: ${{ steps.set-sources-upload-name.outputs.sources-upload-name }} path: ./temp/${{ steps.set-analysis-name.outputs.analysis-name }}/source + include-hidden-files: true if-no-files-found: error retention-days: 1 diff --git a/.github/workflows/public-analyze-code-graph.yml b/.github/workflows/public-analyze-code-graph.yml index bddded158..0aad0e835 100644 --- a/.github/workflows/public-analyze-code-graph.yml +++ b/.github/workflows/public-analyze-code-graph.yml @@ -23,6 +23,7 @@ on: The name of the sources uploaded with 'actions/upload-artifact' containing the content of the 'source' directory for the analysis. Also supports sub-folders for multiple source code bases. + Please use 'include-hidden-files: true' if you also want to upload the git history. required: false type: string default: '' @@ -70,7 +71,11 @@ jobs: - name: Assure that either artifacts-upload-name or sources-upload-name is set if: inputs.artifacts-upload-name == '' && inputs.sources-upload-name == '' run: echo "Please specify either the input parameter 'artifacts-upload-name' or 'sources-upload-name'."; exit 1 - + + - name: (Debug) Log all variables + if: runner.debug == '1' + run: echo "DEBUG log all variables -> $GITHUB_CONTEXT" + - name: Checkout code-graph-analysis-pipeline uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: @@ -142,6 +147,12 @@ jobs: name: ${{ inputs.artifacts-upload-name }} path: temp/${{ inputs.analysis-name }}/artifacts + - name: (Debug) Log folder structure of temp directory + if: runner.debug == '1' + working-directory: temp + run: | + ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' + - name: (Code Analysis) Analyze ${{ inputs.analysis-name }} working-directory: temp/${{ inputs.analysis-name }} # Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed diff --git a/COMMANDS.md b/COMMANDS.md index 2f7414c09..1d9b35894 100644 --- a/COMMANDS.md +++ b/COMMANDS.md @@ -62,7 +62,7 @@ To run all analysis steps simple execute the following command: πŸ‘‰ See [scripts/examples/analyzeAxonFramework.sh](./scripts/examples/analyzeAxonFramework.sh) as an example script that combines all the above steps for a Java Project. πŸ‘‰ See [scripts/examples/analyzeReactRouter.sh](./scripts/examples/analyzeReactRouter.sh) as an example script that combines all the above steps for a Typescript Project. -πŸ‘‰ See [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.yml) on how to do this within a GitHub Actions Workflow. +πŸ‘‰ See [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-analysis.yml) on how to do this within a GitHub Actions Workflow. ### Command Line Options @@ -152,7 +152,7 @@ Change into the [scripts](./scripts/) directory e.g. with `cd scripts` and then Change into the [results](./results/) directory e.g. with `cd results` and then execute the script [generateCsvReportReference.sh](./scripts/documentation/generateCsvReportReference.sh) with the following command: πŸ‘‰**Note:** This script is automatically triggered at the end of [copyReportsIntoResults.sh](./scripts/copyReportsIntoResults.sh) -which is included in the pipeline [java-code-analysis.yml](.github/workflows/java-code-analysis.yml) and doesn't need to be executed manually normally. +which is included in the pipeline [internal-java-code-analysis.yml](.github/workflows/internal-java-code-analysis.yml) and doesn't need to be executed manually normally. ```script ./../scripts/documentation/generateCsvReportReference.sh @@ -163,7 +163,7 @@ which is included in the pipeline [java-code-analysis.yml](.github/workflows/jav Change into the [results](./results/) directory e.g. with `cd results` and then execute the script [generateJupyterReportReference.sh](./scripts/documentation/generateJupyterReportReference.sh) with the following command: πŸ‘‰**Note:** This script is automatically triggered at the end of [copyReportsIntoResults.sh](./scripts/copyReportsIntoResults.sh) -which is included in the pipeline [java-code-analysis.yml](.github/workflows/java-code-analysis.yml) and doesn't need to be executed manually normally. +which is included in the pipeline [internal-java-code-analysis.yml](.github/workflows/internal-java-code-analysis.yml) and doesn't need to be executed manually normally. ```script ./../scripts/documentation/generateJupyterReportReference.sh @@ -174,7 +174,7 @@ which is included in the pipeline [java-code-analysis.yml](.github/workflows/jav Change into the [results](./results/) directory e.g. with `cd results` and then execute the script [generateImageReference.sh](./scripts/documentation/generateImageReference.sh) with the following command: πŸ‘‰**Note:** This script is automatically triggered at the end of [copyReportsIntoResults.sh](./scripts/copyReportsIntoResults.sh) -which is included in the pipeline [java-code-analysis.yml](.github/workflows/java-code-analysis.yml) and doesn't need to be executed manually normally. +which is included in the pipeline [internal-java-code-analysis.yml](.github/workflows/internal-java-code-analysis.yml) and doesn't need to be executed manually normally. ```script ./../scripts/documentation/generateImageReference.sh diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 862436c86..5fb5dd58d 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -112,4 +112,4 @@ Use these optional command line options as needed: ## GitHub Actions -πŸ‘‰ See [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.yml) on how to do this within a GitHub Actions Workflow. +πŸ‘‰ See [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-analysis.yml) on how to do this within a GitHub Actions Workflow. diff --git a/INTEGRATION.md b/INTEGRATION.md index f3d10b70d..d3e1209e7 100644 --- a/INTEGRATION.md +++ b/INTEGRATION.md @@ -18,8 +18,8 @@ The workflow requires the names of the uploaded artifacts (source code and build You can find examples in: -- [internal-java-code-analysis.yml](./.github/workflows/internal-java-code-analysis.yml) -- [internal-typescript-code-analysis.yml](./.github/workflows/internal-typescript-code-analysis.yml) +- [internal-internal-java-code-analysis.yml](./.github/workflows/internal-internal-java-code-analysis.yml) +- [internal-internal-typescript-code-analysis.yml](./.github/workflows/internal-internal-typescript-code-analysis.yml) :warning: Note: Workflows with names starting with `internal-` are private and should not be used outside this repository. They may change at any time without notice. @@ -30,6 +30,7 @@ The workflow parameters are as follows: - **analysis-name**: The name of the project to analyze. Example: MyProject-1.0.0. This parameter is required and should be a string. - **artifacts-upload-name**: The name of the artifacts uploaded with [actions/upload-artifact](https://github.com/actions/upload-artifact/tree/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) containing the content of the 'artifacts' directory for the analysis. This is used to analyze Java JARs, WARs, EARs, etc. This parameter is optional and defaults to an empty string. - **sources-upload-name**: The name of the sources uploaded with [actions/upload-artifact](https://github.com/actions/upload-artifact/tree/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) containing the content of the 'source' directory for the analysis. It also supports sub-folders for multiple source code bases. This parameter is optional and defaults to an empty string. +Please use 'include-hidden-files: true' if you also want to upload the git history. - **ref**: The branch, tag, or SHA of the code-graph-analysis-pipeline to checkout. This parameter is optional and defaults to "main". - **analysis-arguments**: The arguments to pass to the analysis script. This parameter is optional and defaults to '--profile Neo4jv5-low-memory'. - **typescript-scan-heap-memory**: The heap memory size in MB to use for the TypeScript code scans. This value is only used for the TypeScript code scans and is ignored for other scans. This parameter is optional and defaults to '4096'. diff --git a/README.md b/README.md index f70cfccca..9f484adad 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Contained within this repository is a comprehensive and automated code graph ana - Analyze static code structure as a graph - Supports Java Code Analysis - **🌟New🌟:** Supports Typescript Code Analysis (experimental) -- Fully automated [pipeline for Java](./.github/workflows/java-code-analysis.yml) from tool installation to report generation -- Fully automated [pipeline for Typescript](./.github/workflows/typescript-code-analysis.yml) from tool installation to report generation +- Fully automated [pipeline for Java](./.github/workflows/internal-java-code-analysis.yml) from tool installation to report generation +- Fully automated [pipeline for Typescript](./.github/workflows/internal-typescript-code-analysis.yml) from tool installation to report generation - Fully automated [local run](./GETTING_STARTED.md) - Easy integratable in your [continuous integration pipeline](./INTEGRATION.md) - More than 130 CSV reports for dependencies, metrics, cycles, annotations, algorithms and many more @@ -113,7 +113,7 @@ Currently (2025), only GitHub Actions are supported. ## :building_construction: Pipeline and Tools -The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.yml) utilizes [GitHub Actions](https://docs.github.com/de/actions) to automate the whole analysis process: +The [Code Structure Analysis Pipeline](./.github/workflows/internal-java-code-analysis.yml) utilizes [GitHub Actions](https://docs.github.com/de/actions) to automate the whole analysis process: - Use [GitHub Actions](https://docs.github.com/de/actions) Linux Runner - [Checkout GIT Repository](https://github.com/actions/checkout) @@ -139,7 +139,7 @@ The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.ym - [Graph Visualization](./graph-visualization/README.md) uses [node.js](https://nodejs.org/de) and the dependencies listed in [package.json](./graph-visualization/package.json). - [HPCC-Systems (High Performance Computing Cluster) Web-Assembly (JavaScript)](https://github.com/hpcc-systems/hpcc-js-wasm) containing a wrapper for GraphViz to visualize graph structures. - [GraphViz](https://gitlab.com/graphviz/graphviz) for CLI Graph Visualization -- [Check links in markdown documentation (GitHub workflow)](./.github/workflows/check-links-in-documentation.yml) uses [markdown-link-check](https://github.com/tcort/markdown-link-check). +- [Check links in markdown documentation (GitHub workflow)](./.github/workflows/internal-check-links-in-documentation.yml) uses [markdown-link-check](https://github.com/tcort/markdown-link-check). **Big shout-out** πŸ“£ to all the creators and contributors of these great libraries πŸ‘. Projects like this wouldn't be possible without them. Feel free to [create an issue](https://github.com/JohT/code-graph-analysis-pipeline/issues/new/choose) if something is missing or wrong in the list. @@ -193,7 +193,7 @@ The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.ym - How can i analyze a different code basis automatically? πŸ‘‰ Create a new download script like the ones in the [scripts/downloader](./scripts/downloader/) directory. Take for example [downloadAxonFramework.sh](./scripts/downloader/downloadAxonFramework.sh) as a reference for Java projects and [downloadReactRouter.sh](./scripts/downloader/downloadReactRouter.sh) as a reference for Typescript projects. - πŸ‘‰ After downloading, run [analyze.sh](./scripts/analysis/analyze.sh). You can find these steps also in the [pipeline](./.github/workflows/java-code-analysis.yml) as a reference. + πŸ‘‰ After downloading, run [analyze.sh](./scripts/analysis/analyze.sh). You can find these steps also in the [pipeline](./.github/workflows/internal-java-code-analysis.yml) as a reference. - How can i trigger a full re-scan of all artifacts? πŸ‘‰ Delete the file `artifactsChangeDetectionHash.txt` in the `artifacts` directory.