You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "kpumuk (via GitHub)" <gi...@apache.org> on 2026/05/03 16:59:48 UTC
[PR] Parallelize static code analysis run on GitHub [thrift]
kpumuk opened a new pull request, #3443:
URL: https://github.com/apache/thrift/pull/3443
<!-- Explain the changes in the pull request below: -->
Currently SCA job runs as a single monolythic workflow, with each job checking different libraries separately. Jobs are allowed to fail, and there is a final summary job that check the status of each other job and fails if any failed. This makes it a little bit hard to read, makes the job slower, and somewhat hard to add new languages.
This pull request follows the similar structure we have in our `build.yml` - each language gets its own job, that depends on compiler build (used to generate thrift and verify generated code to follow the same rules as the library itself).
<!-- We recommend you review the checklist/tips before submitting a pull request. -->
- [ ] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket? ([Request account here](https://selfserve.apache.org/jira-account.html), not required for trivial changes)
- [ ] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
- [x] Did you squash your changes to a single commit? (not required, but preferred)
- [x] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
- [ ] If your change does not involve any code, include `[skip ci]` anywhere in the commit message to free up build resources.
<!--
The Contributing Guide at:
https://github.com/apache/thrift/blob/master/CONTRIBUTING.md
has more details and tips for committing properly.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-5967: Parallelize static code analysis run on GitHub [thrift]
Posted by "kpumuk (via GitHub)" <gi...@apache.org>.
kpumuk merged PR #3443:
URL: https://github.com/apache/thrift/pull/3443
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Parallelize static code analysis run on GitHub [thrift]
Posted by "kpumuk (via GitHub)" <gi...@apache.org>.
kpumuk commented on code in PR #3443:
URL: https://github.com/apache/thrift/pull/3443#discussion_r3178476698
##########
.github/workflows/sca.yml:
##########
@@ -146,6 +185,137 @@ jobs:
-i lib/c_glib/test/gen-cpp \
--error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
+ lib-python:
+ needs: compiler
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -yq
+ # shellcheck disable=SC2086
+ sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
+
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: "3.12"
+
+ - name: Install Python test dependencies
+ run: |
+ python -m pip install --upgrade pip setuptools wheel flake8
+
+ - name: Configure
+ run: |
+ ./bootstrap.sh
+ # shellcheck disable=SC2086
+ ./configure $CONFIG_ARGS_FOR_SCA
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: thrift-compiler
+ path: compiler/cpp
+
+ - name: Generate Python thrift files
+ run: |
+ chmod a+x compiler/cpp/thrift
+ compiler/cpp/thrift -version
+ make -j"$(nproc)" -C test/py precross
+
+ - name: Run flake8
+ run: flake8
+
+ lib-php:
+ needs: compiler
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -yq
+ # shellcheck disable=SC2086
+ sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
+
+ - name: Set up PHP
+ uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
+ with:
+ # Lowest supported PHP version
+ php-version: "8.1"
+ extensions: mbstring, xml, curl, pcntl
+
+ - name: Configure
+ run: |
+ ./bootstrap.sh
+ # shellcheck disable=SC2086
+ ./configure $CONFIG_ARGS_FOR_SCA
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: thrift-compiler
+ path: compiler/cpp
+
+ - name: Generate PHP thrift files
+ run: |
+ chmod a+x compiler/cpp/thrift
+ compiler/cpp/thrift -version
+ make -j"$(nproc)" -C lib/php/test stubs
+ make -j"$(nproc)" -C test/php precross
+
+ - name: Run phpcs
+ run: |
+ composer install --quiet
+ ./vendor/bin/phpcs
Review Comment:
Yeah, I updated path in the phpcs.xml.dist, which apparently had an outdated path. Because of how I set up `sca.yml` before, it did not generate PHP fixtures before running phpcs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] THRIFT-5967: Parallelize static code analysis run on GitHub [thrift]
Posted by "kpumuk (via GitHub)" <gi...@apache.org>.
kpumuk commented on PR #3443:
URL: https://github.com/apache/thrift/pull/3443#issuecomment-4366824504
Created an umbrella ticket https://issues.apache.org/jira/browse/THRIFT-5966 to add SCA for other libraries.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Parallelize static code analysis run on GitHub [thrift]
Posted by "sveneld (via GitHub)" <gi...@apache.org>.
sveneld commented on code in PR #3443:
URL: https://github.com/apache/thrift/pull/3443#discussion_r3178473241
##########
.github/workflows/sca.yml:
##########
@@ -146,6 +185,137 @@ jobs:
-i lib/c_glib/test/gen-cpp \
--error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
+ lib-python:
+ needs: compiler
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -yq
+ # shellcheck disable=SC2086
+ sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
+
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: "3.12"
+
+ - name: Install Python test dependencies
+ run: |
+ python -m pip install --upgrade pip setuptools wheel flake8
+
+ - name: Configure
+ run: |
+ ./bootstrap.sh
+ # shellcheck disable=SC2086
+ ./configure $CONFIG_ARGS_FOR_SCA
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: thrift-compiler
+ path: compiler/cpp
+
+ - name: Generate Python thrift files
+ run: |
+ chmod a+x compiler/cpp/thrift
+ compiler/cpp/thrift -version
+ make -j"$(nproc)" -C test/py precross
+
+ - name: Run flake8
+ run: flake8
+
+ lib-php:
+ needs: compiler
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -yq
+ # shellcheck disable=SC2086
+ sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
+
+ - name: Set up PHP
+ uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
+ with:
+ # Lowest supported PHP version
+ php-version: "8.1"
+ extensions: mbstring, xml, curl, pcntl
+
+ - name: Configure
+ run: |
+ ./bootstrap.sh
+ # shellcheck disable=SC2086
+ ./configure $CONFIG_ARGS_FOR_SCA
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: thrift-compiler
+ path: compiler/cpp
+
+ - name: Generate PHP thrift files
+ run: |
+ chmod a+x compiler/cpp/thrift
+ compiler/cpp/thrift -version
+ make -j"$(nproc)" -C lib/php/test stubs
+ make -j"$(nproc)" -C test/php precross
+
+ - name: Run phpcs
+ run: |
+ composer install --quiet
+ ./vendor/bin/phpcs
Review Comment:
I see that generated php files get many errors, I plan to fix style for generated classes.
As temporary solution phpcs can be run like this
```
./vendor/bin/phpcs --ignore=*/test/Resources/*
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Parallelize static code analysis run on GitHub [thrift]
Posted by "sveneld (via GitHub)" <gi...@apache.org>.
sveneld commented on code in PR #3443:
URL: https://github.com/apache/thrift/pull/3443#discussion_r3178473241
##########
.github/workflows/sca.yml:
##########
@@ -146,6 +185,137 @@ jobs:
-i lib/c_glib/test/gen-cpp \
--error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
+ lib-python:
+ needs: compiler
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -yq
+ # shellcheck disable=SC2086
+ sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
+
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: "3.12"
+
+ - name: Install Python test dependencies
+ run: |
+ python -m pip install --upgrade pip setuptools wheel flake8
+
+ - name: Configure
+ run: |
+ ./bootstrap.sh
+ # shellcheck disable=SC2086
+ ./configure $CONFIG_ARGS_FOR_SCA
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: thrift-compiler
+ path: compiler/cpp
+
+ - name: Generate Python thrift files
+ run: |
+ chmod a+x compiler/cpp/thrift
+ compiler/cpp/thrift -version
+ make -j"$(nproc)" -C test/py precross
+
+ - name: Run flake8
+ run: flake8
+
+ lib-php:
+ needs: compiler
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -yq
+ # shellcheck disable=SC2086
+ sudo apt-get install -y --no-install-recommends g++ $BUILD_DEPS
+
+ - name: Set up PHP
+ uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
+ with:
+ # Lowest supported PHP version
+ php-version: "8.1"
+ extensions: mbstring, xml, curl, pcntl
+
+ - name: Configure
+ run: |
+ ./bootstrap.sh
+ # shellcheck disable=SC2086
+ ./configure $CONFIG_ARGS_FOR_SCA
+
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: thrift-compiler
+ path: compiler/cpp
+
+ - name: Generate PHP thrift files
+ run: |
+ chmod a+x compiler/cpp/thrift
+ compiler/cpp/thrift -version
+ make -j"$(nproc)" -C lib/php/test stubs
+ make -j"$(nproc)" -C test/php precross
+
+ - name: Run phpcs
+ run: |
+ composer install --quiet
+ ./vendor/bin/phpcs
Review Comment:
I see that generated php files get many errors, I plan to fix style for generated classes.
As temporary solution phpcs can be run like this
./vendor/bin/phpcs --ignore=*/test/Resources/*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org