Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Add client sided endpoints parser #8580

Merged
merged 255 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
9e7b856
Merge remote-tracking branch 'origin/development/github-action-analyz…
Jan-Thurner Apr 16, 2024
67521a5
Update .github/workflows/alaysis-of-endpoint-connections.yml
Jan-Thurner Apr 16, 2024
9ed4bc2
adjusted the action to fetch compare the diffs of the latest commits
Jan-Thurner Apr 16, 2024
e0f8316
adjusted the action to fetch compare the diffs of the latest commits …
Jan-Thurner Apr 16, 2024
cba5afe
Update .github/workflows/alaysis-of-endpoint-connections.yml
Jan-Thurner Apr 16, 2024
a607f2a
fixed typo in file name
Jan-Thurner Apr 16, 2024
8f81179
Update .github/workflows/analysis-of-endpoint-connections.yml
Jan-Thurner Apr 16, 2024
3095b8c
simplified printing output
Jan-Thurner Apr 16, 2024
8ad19a6
adjusted files to process
Jan-Thurner Apr 16, 2024
9003ac8
reverted test changes
Jan-Thurner Apr 16, 2024
7133e61
Merge branch 'develop' into development/github-action-analyzing-endpo…
Jan-Thurner Apr 19, 2024
d4d1e04
implement Markus' feedback
Jan-Thurner Apr 20, 2024
7c1d613
Extend github action by a script do identify files containing endpoints.
Jan-Thurner Apr 21, 2024
b989a25
removed incorrect file
Jan-Thurner Apr 21, 2024
30b4ebc
replaced the scripts file name with its path
Jan-Thurner Apr 21, 2024
4ac5ccb
replaced gitDiff for local testing with gitDiff for PRs
Jan-Thurner Apr 21, 2024
0060d04
download modified files to reuse its contents for a new job.
Jan-Thurner Apr 21, 2024
488477d
moved running of script to the same job as finding changed files
Jan-Thurner Apr 21, 2024
766469f
removed branches ignore
Jan-Thurner Apr 22, 2024
22bdaa6
Merge branch 'develop' into development/github-action-analyzing-endpo…
Jan-Thurner Apr 22, 2024
c85d11e
removed id
Jan-Thurner Apr 22, 2024
e118b91
Merge branch 'development/github-action-analyzing-endpoint-connection…
Jan-Thurner Apr 22, 2024
2bafdfe
removed outcommented code
Jan-Thurner Apr 22, 2024
965fd85
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 2, 2024
05c28a4
Changed analysis of server sided endpoints to java and the use of QDo…
Jan-Thurner May 2, 2024
73ffa60
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 2, 2024
51b3fe5
added Package to java file
Jan-Thurner May 2, 2024
aef9284
added Package
Jan-Thurner May 3, 2024
8883f08
changed job name to analysis-of-endpoint-connections
Jan-Thurner May 3, 2024
b07234d
removed test changes
Jan-Thurner May 3, 2024
9018f61
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 3, 2024
9365eea
replaced var with explicit variable declaration
Jan-Thurner May 3, 2024
385d510
made comparison strings constant (final)
Jan-Thurner May 5, 2024
92097fb
removed duplicate execution steps
Jan-Thurner May 5, 2024
cc2866a
removed test change
Jan-Thurner May 5, 2024
da7dce5
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 5, 2024
a1d6572
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner May 5, 2024
072404a
Used list of httpMethodFullNames for filtering out endpoints. Also, c…
Jan-Thurner May 6, 2024
a7537b9
removed unnecessary empty line
Jan-Thurner May 7, 2024
bc07100
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 8, 2024
ae25a3f
added parsing of client sided REST-api calls and the respective Paths…
Jan-Thurner May 8, 2024
21d5863
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner May 12, 2024
71b7194
integrate client sided parser into gitHub action
Jan-Thurner May 13, 2024
ac69044
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner May 13, 2024
fd8d453
added testChanges
Jan-Thurner May 13, 2024
ef82259
only parse typescript files
Jan-Thurner May 13, 2024
fa9371e
Error handling for missing REST call arguments
Jan-Thurner May 13, 2024
fedd05b
change package.json type to commonjs
Jan-Thurner May 13, 2024
7e768bf
Update supporting_scripts/analysis-of-endpoint-connections/build.gradle
Jan-Thurner May 14, 2024
75c4756
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 14, 2024
0de1872
Use same spring boot version for parser as for artemis itself.
Jan-Thurner May 15, 2024
da01c81
add processing of annotations following this format: @RequestMapping(…
Jan-Thurner May 15, 2024
5f49288
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 15, 2024
68280c1
fix code style issues
Jan-Thurner May 15, 2024
c94567a
fix code style issues
Jan-Thurner May 15, 2024
2dd6895
fix code style issues
Jan-Thurner May 15, 2024
919b952
fix code style issues
Jan-Thurner May 15, 2024
9ad9512
fix code style issues
Jan-Thurner May 15, 2024
d7c00e0
fix code style issues
Jan-Thurner May 15, 2024
451b526
fix code style issues, warning mode --all
Jan-Thurner May 15, 2024
ca0c37b
fix code style issues, warning mode --all
Jan-Thurner May 15, 2024
8c20296
fix code style issues, warning mode --all
Jan-Thurner May 15, 2024
8b93a54
fix code style issues, warning mode --all
Jan-Thurner May 15, 2024
b8ab586
fix code style issues, warning mode --all
Jan-Thurner May 15, 2024
d7c30de
fix code style issues, warning mode --all
Jan-Thurner May 15, 2024
b6ab535
adapt building and running of the server sided endpoint parser to use…
Jan-Thurner May 16, 2024
bef4e58
added test changes
Jan-Thurner May 16, 2024
595474a
added support for passing on parameters to the java main
Jan-Thurner May 16, 2024
522a2c0
added test output
Jan-Thurner May 16, 2024
c71694f
added test output
Jan-Thurner May 16, 2024
19d7e44
split args at new line
Jan-Thurner May 16, 2024
4a11796
split args in GitHub action
Jan-Thurner May 16, 2024
fc6d3f7
fix format issue
Jan-Thurner May 16, 2024
a6dcb2e
split Args in java file
Jan-Thurner May 16, 2024
7a18430
Added testoutputs
Jan-Thurner May 16, 2024
32202e8
Added testoutputs
Jan-Thurner May 16, 2024
a035b44
Added testoutputs
Jan-Thurner May 16, 2024
20a7c94
Added testoutputs and changed split char to ' '
Jan-Thurner May 16, 2024
52e8cc1
Added testoutputs
Jan-Thurner May 16, 2024
d1b57e9
Added testoutputs
Jan-Thurner May 16, 2024
a6ce253
change working directory to root of project
Jan-Thurner May 16, 2024
b18332f
revert change working directory to root of project and output working…
Jan-Thurner May 16, 2024
09b7679
change working directory to root of project and output working direct…
Jan-Thurner May 16, 2024
30e5323
revert change working directory to root of project and output working…
Jan-Thurner May 16, 2024
e077133
look for existing files in second parent directory of working directory
Jan-Thurner May 16, 2024
0b325bd
remove debugging printlns.
Jan-Thurner May 16, 2024
b19faa8
remove duplicate addition of "../../" to the file paths
Jan-Thurner May 16, 2024
0a89787
remove final debugging outputs
Jan-Thurner May 16, 2024
1cc3384
remove final debugging outputs
Jan-Thurner May 16, 2024
dbb59a5
remove outdated code and fix codestyle issues
Jan-Thurner May 16, 2024
ce941c7
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 16, 2024
b43f9ac
remove test change
Jan-Thurner May 16, 2024
a450d2a
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner May 16, 2024
b4c8915
remove unused code
Jan-Thurner May 16, 2024
a1b5fec
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 17, 2024
c68fbe2
remove unused code
Jan-Thurner May 19, 2024
3a736fb
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner May 19, 2024
0594dba
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 19, 2024
e141634
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 20, 2024
1b69c1b
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 22, 2024
404fd0f
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner May 22, 2024
ef92ee3
fix CodeStyleIssues
Jan-Thurner May 22, 2024
29fc44f
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner May 22, 2024
4fba7b6
fix Codeacy Static code analysis issue
Jan-Thurner May 22, 2024
9d6c3e0
Integrate Class Literals into REST call URLs
Jan-Thurner May 22, 2024
0dd1823
remove ${...}
Jan-Thurner May 22, 2024
5c2cba2
remove ${...}
Jan-Thurner May 22, 2024
5e084bb
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 23, 2024
b1610f2
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 24, 2024
1657a0a
reuse dependencies from Artemis root project.
Jan-Thurner May 24, 2024
61d99df
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner May 24, 2024
2f8790c
use qDoxVersionReusable for qDox
Jan-Thurner May 24, 2024
e70a11d
Rename Package from "analysisOfEndpointConnections" to "de.tum.cit.en…
Jan-Thurner May 24, 2024
41e084a
add test change
Jan-Thurner May 24, 2024
b221d68
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 24, 2024
b9c1458
revert test change
Jan-Thurner May 24, 2024
1828a31
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner May 24, 2024
5f846b6
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 24, 2024
2053657
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 25, 2024
156d51e
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner May 26, 2024
c371c1c
Use sets and Classes for Annotation verification.
Jan-Thurner May 27, 2024
f7c90fe
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner May 27, 2024
a668945
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner Jun 1, 2024
86d7d96
Fix code Style Issues
Jan-Thurner Jun 1, 2024
006895b
TestChange
Jan-Thurner Jun 1, 2024
4d296ee
revert TestChange
Jan-Thurner Jun 1, 2024
1af4c43
Update supporting_scripts/analysis-of-endpoint-connections/src/main/j…
Jan-Thurner Jun 1, 2024
8720599
revert TestChange
Jan-Thurner Jun 1, 2024
cb9c23d
Merge remote-tracking branch 'origin/development/parsing-of-server-si…
Jan-Thurner Jun 1, 2024
69f8117
add missing imports
Jan-Thurner Jun 1, 2024
3df8b78
Merge branch 'develop' into development/parsing-of-server-sided-endpo…
Jan-Thurner Jun 1, 2024
045ad09
changed the way relevant files are filtered out again.
Jan-Thurner Jun 1, 2024
05a1eba
revert test changes
Jan-Thurner Jun 1, 2024
828d7b2
Revert "revert test changes"
Jan-Thurner Jun 1, 2024
266fa33
Revert "changed the way relevant files are filtered out again."
Jan-Thurner Jun 1, 2024
84fbfa4
revert test changes
Jan-Thurner Jun 1, 2024
969e352
fix codestyle
Jan-Thurner Jun 1, 2024
063d802
Merge branch 'development/parsing-of-server-sided-endpoints' into fea…
Jan-Thurner Jun 1, 2024
1524570
remove old code to finish merge
Jan-Thurner Jun 1, 2024
32a3b99
remove duplicate imports from subproject package.json (supporting_scr…
Jan-Thurner Jun 2, 2024
7af68da
install typescript in parent directory
Jan-Thurner Jun 2, 2024
29bcde3
undo previous two changes to not inherit node import from parent dire…
Jan-Thurner Jun 2, 2024
e577dcc
remove redundant step in setup of client parsing
Jan-Thurner Jun 2, 2024
c34a650
undo changes in dependency specification
Jan-Thurner Jun 2, 2024
d02b2b5
remove duplicate installation of typescript
Jan-Thurner Jun 2, 2024
503e793
remove testChange
Jan-Thurner Jun 2, 2024
ffa54e9
implement Feedback by @RaphaelStief
Jan-Thurner Jun 3, 2024
81b9aa7
add test change to test the parser in the action
Jan-Thurner Jun 3, 2024
ced4ee8
remove test change to test the parser in the action
Jan-Thurner Jun 3, 2024
e0728d4
feedback Johannes
Jan-Thurner Jun 5, 2024
a28b171
add change to test the action
Jan-Thurner Jun 5, 2024
ef4a64c
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 5, 2024
6c2e91e
remove change to test the action
Jan-Thurner Jun 5, 2024
fa85134
implement CodeRabbit Suggestions
Jan-Thurner Jun 5, 2024
5611a83
new test change
Jan-Thurner Jun 5, 2024
11ec4e6
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 5, 2024
e11e027
remove test change
Jan-Thurner Jun 5, 2024
823b635
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Jun 5, 2024
3db8884
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 7, 2024
92ad0b9
implement most of @Markus' feedback
Jan-Thurner Jun 9, 2024
bb542e3
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 9, 2024
5b283b3
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Jun 9, 2024
bca05fb
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Jun 9, 2024
29cfb3d
add testChange
Jan-Thurner Jun 9, 2024
3c37828
check if httpClient is of type httpClient
Jan-Thurner Jun 9, 2024
bec6ecd
extract methods to improve code quality
Jan-Thurner Jun 12, 2024
cacd193
group rest calls from the same files together
Jan-Thurner Jun 12, 2024
e1d7b4c
add more test changes
Jan-Thurner Jun 12, 2024
1db18df
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 12, 2024
b64c9d0
remove test changes
Jan-Thurner Jun 12, 2024
39ccb76
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Jun 12, 2024
6388c14
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 14, 2024
b898326
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 14, 2024
fdcc886
implement feedback
Jan-Thurner Jun 17, 2024
5d616f2
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Jun 17, 2024
0d5513e
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 21, 2024
83c05ea
Feedback Stephan
Jan-Thurner Jun 23, 2024
ba521e6
Feedback Stephan
Jan-Thurner Jun 23, 2024
39a9139
testChange
Jan-Thurner Jun 23, 2024
a82dcaa
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Jun 23, 2024
f2fd984
add javadocs
Jan-Thurner Jun 23, 2024
07ae891
use CommonJs
Jan-Thurner Jun 23, 2024
85c78c3
remove testChange
Jan-Thurner Jun 23, 2024
da26bbb
remove ^
Jan-Thurner Jun 23, 2024
541ebed
remove type from tsDox
Jan-Thurner Jun 23, 2024
eb251f3
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 23, 2024
ff74221
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jun 24, 2024
603ed82
improve parser
Jan-Thurner Jun 25, 2024
17772ba
improve parser. now also parse 'this.http.get<OrganizationCountDto[]>…
Jan-Thurner Jun 27, 2024
9ea2c06
parser now recognizes method variables
Jan-Thurner Jun 28, 2024
979e053
REST calls with multiple possible URLs in a single function are logged.
Jan-Thurner Jun 28, 2024
739560a
REST calls with multiple possible URLs in multiple functions are logged.
Jan-Thurner Jun 28, 2024
1583419
Revert "REST calls with multiple possible URLs in multiple functions …
Jan-Thurner Jun 29, 2024
60a4c45
Revert REST calls with multiple possible URLs in multiple functions a…
Jan-Thurner Jun 29, 2024
bd41c4c
remove old parser
Jan-Thurner Jul 3, 2024
57e0467
almost done
Jan-Thurner Jul 13, 2024
3ebc22a
only a few bugs remaining
Jan-Thurner Jul 14, 2024
962fd07
still needs documentation
Jan-Thurner Jul 15, 2024
2ec7263
removed unused code
Jan-Thurner Jul 15, 2024
9a36750
Store identified RestCalls in .json file
Jan-Thurner Jul 15, 2024
cfa6a01
so far, the refactored code works
Jan-Thurner Jul 25, 2024
83099f0
refactor BinaryExpressions too
Jan-Thurner Jul 25, 2024
b517a44
last edge case implemented
Jan-Thurner Jul 25, 2024
9ac520f
fix stack Overflow (remove potential endless loop)
Jan-Thurner Jul 26, 2024
abb94ce
- remove test Files
Jan-Thurner Jul 26, 2024
eb5a63f
replace reduce with for loop for cleaner control flow
Jan-Thurner Jul 26, 2024
d01c61d
Catch URLs that cannot be parsed.
Jan-Thurner Jul 26, 2024
401d948
remove unused code
Jan-Thurner Jul 26, 2024
642b39a
Preprocessor: remove unused code and add documentation
Jan-Thurner Jul 27, 2024
ea91e2f
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jul 27, 2024
6005644
parse entire client
Jan-Thurner Jul 27, 2024
4ec9aaa
add test change to start action
Jan-Thurner Jul 27, 2024
10dd980
debugging Action and CWD
Jan-Thurner Jul 27, 2024
3ed69af
run serverSided analysis only on changed Files
Jan-Thurner Jul 27, 2024
c5d06e0
print output to logFile instead of console for now
Jan-Thurner Jul 27, 2024
da20f0e
upload logFile
Jan-Thurner Jul 27, 2024
eab5823
change ResultFilePath
Jan-Thurner Jul 27, 2024
6a010c5
more debugging
Jan-Thurner Jul 27, 2024
004cb2c
more debugging
Jan-Thurner Jul 27, 2024
7fae762
more debugging
Jan-Thurner Jul 27, 2024
d688871
remove test change and small Docs improvement
Jan-Thurner Jul 27, 2024
06ee46e
CodeRabbit
Jan-Thurner Jul 27, 2024
ba94287
CodeRabbit
Jan-Thurner Jul 27, 2024
aecbef1
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Jul 28, 2024
405065e
Update .github/workflows/analysis-of-endpoint-connections.yml
Jan-Thurner Jul 28, 2024
c53c68e
Update .github/workflows/analysis-of-endpoint-connections.yml
Jan-Thurner Jul 28, 2024
d41d673
Json before Changes
Jan-Thurner Aug 4, 2024
f19b38c
Review Feedback
Jan-Thurner Aug 5, 2024
96ed010
update package.json
Jan-Thurner Aug 5, 2024
6a63e41
Update supporting_scripts/analysis-of-endpoint-connections/src/main/t…
Jan-Thurner Aug 5, 2024
e099d04
Update supporting_scripts/analysis-of-endpoint-connections/src/main/t…
Jan-Thurner Aug 5, 2024
3469f37
make ast readonly
Jan-Thurner Aug 5, 2024
fdef534
Merge remote-tracking branch 'origin/feature/development/parsing-clie…
Jan-Thurner Aug 5, 2024
80d3e34
add docs do postprocessor.ts
Jan-Thurner Aug 5, 2024
4c88dc8
remove restCalls json
Jan-Thurner Aug 5, 2024
25f6fbe
remove restCalls json
Jan-Thurner Aug 5, 2024
97c8fe9
run action on workflow dispatch
Jan-Thurner Aug 5, 2024
713557a
update package.json
Jan-Thurner Aug 5, 2024
90c5da9
update package.json
Jan-Thurner Aug 5, 2024
54f6378
update package.json
Jan-Thurner Aug 5, 2024
944ce3e
update package.json
Jan-Thurner Aug 5, 2024
29b7671
update package.json
Jan-Thurner Aug 5, 2024
042094d
remove test change
Jan-Thurner Aug 5, 2024
b706f53
coderabbit
Jan-Thurner Aug 5, 2024
2960f24
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Aug 6, 2024
03725c8
CodeStyle Johannes
Jan-Thurner Aug 7, 2024
d3d9273
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Aug 8, 2024
291b4fb
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Aug 9, 2024
4a0f89b
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Aug 12, 2024
e13cf74
Merge branch 'develop' into feature/development/parsing-client-sided-…
Jan-Thurner Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 62 additions & 36 deletions .github/workflows/analysis-of-endpoint-connections.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,62 @@
# As this GitHub Workflow currently fails for many valid pull requests, it is currently disabled.

#name: Analysis-of-Endpoint-Connections
#
#on:
# pull_request:
# types:
# - opened
# - synchronize
# paths:
# - 'src/main/java/**'
# - 'src/main/webapp/**'
#
#jobs:
# analysis-of-endpoint-connections:
# timeout-minutes: 10
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Get list of modified files
# run: |
# git diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD > modified_files.txt
#
# - name: Set up JDK 21
# uses: actions/setup-java@v2
# with:
# java-version: '21'
# distribution: 'adopt'
#
# - name: Run analysis-of-endpoint-connections
# run: |
# ./gradlew :supporting_scripts:analysis-of-endpoint-connections:run --args="$(cat modified_files.txt)"
on:
workflow_dispatch:
pull_request:
types:
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
- opened
- synchronize
paths:
- 'src/main/java/**'
- 'src/main/webapp/**'

Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
# Keep in sync with build.yml and test.yml and codeql-analysis.yml
env:
CI: true
node: 20
java: 21

Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
jobs:
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
analysis-of-endpoint-connections:
timeout-minutes: 10
runs-on: ubuntu-latest
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
steps:
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get list of modified files
run: |
git diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD > modified_files.txt

Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
# Analyze the client sided REST-API calls
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '${{ env.node }}'

- name: Install and compile TypeScript
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd supporting_scripts/analysis-of-endpoint-connections/src/main/typeScript/
npm install
tsc -p tsconfig.analysisOfEndpointConnections.json

Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
- name: Run analysis-of-endpoint-connections-client
run: |
node supporting_scripts/analysis-of-endpoint-connections/src/main/typeScript/AnalysisOfEndpointConnectionsClient.js

Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
- name: Upload JSON file
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/upload-artifact@v4
with:
name: rest-calls-json
path: supporting_scripts/analysis-of-endpoint-connections/restCalls.json

# Analyze the server sided endpoints
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '${{ env.java }}'

Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
- name: Run analysis-of-endpoint-connections
run: |
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
./gradlew :supporting_scripts:analysis-of-endpoint-connections:run --args="$(cat modified_files.txt)"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
types:
- created

# Keep in sync with codeql-analysis.yml and test.yml
# Keep in sync with codeql-analysis.yml and test.yml and analysis-of-endpoint-connections.yml
env:
CI: true
node: 20
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
schedule:
- cron: '0 16 * * 0'

# Keep in sync with build.yml and test.yml
# Keep in sync with build.yml and test.yml and analysis-of-endpoint-connections.yml
env:
CI: true
node: 20
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {},
"settings": {
"react": {
"version": "detect"
}
}
}
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { readdirSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { Preprocessor } from './Preprocessor';
import { Postprocessor } from './Postprocessor';
import { writeFileSync } from 'node:fs';

/**
* Recursively collects all TypeScript files in a directory.
*
* @param dir - The directory to search for TypeScript files.
* @param files - An array to store the collected TypeScript file paths.
* @returns An array of TypeScript file paths relative to 'src/main/webapp/app'.
*/
function collectTypeScriptFiles(dir: string, files: string[] = []) : string[] {
const entries = readdirSync(dir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = join(dir, entry.name);

const filePathFromSrcFolder = fullPath.substring(fullPath.indexOf('src/main/webapp/app'));
if (entry.isDirectory()) {
collectTypeScriptFiles(fullPath, files);
} else if (entry.isFile() && entry.name.endsWith('.ts')) {
files.push(filePathFromSrcFolder);
}
}
return files;
}
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved

const clientDirPath = resolve('src/main/webapp/app');

const tsFiles = collectTypeScriptFiles(clientDirPath);

// preprocess each file
tsFiles.forEach((filePath) => {
const preProcessor = new Preprocessor(filePath);
preProcessor.preprocessFile();
});
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved

// postprocess each file
tsFiles.forEach((filePath) => {
const postProcessor = new Postprocessor(filePath);
postProcessor.extractRestCalls();
});
Jan-Thurner marked this conversation as resolved.
Show resolved Hide resolved

try {
writeFileSync('supporting_scripts/analysis-of-endpoint-connections/restCalls.json', JSON.stringify(Postprocessor.filesWithRestCalls, null, 2));
} catch (error) {
console.error('Failed to write REST calls to file:', error);
}
Loading
Loading