Skip to content

RUMM-2845: Speed up build of sample app for CodeQL scan#1221

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/rumm-2845/speed-up-sample-app-build-for-codeql-scan
Jan 9, 2023
Merged

RUMM-2845: Speed up build of sample app for CodeQL scan#1221
0xnm merged 1 commit into
developfrom
nogorodnikov/rumm-2845/speed-up-sample-app-build-for-codeql-scan

Conversation

@0xnm

@0xnm 0xnm commented Jan 9, 2023

Copy link
Copy Markdown
Member

What does this PR do?

Gradle build for the CodeQL scan take 35-40 minutes it seems, because all the variants ((eu1, us1, us3, us5, us1_fed, staging) x (debug,release) = 12) are built (it takes majority of the build).

To speed it up and still have a complete coverage of all the binaries which can be created in the customer environment (not only release artifacts, but also binaries which can be created by cloning this repo), let's build only us1 flavor for sample app, because all DC flavors are the same code-wise.

To speed it up we are going to build only releasable modules.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

Comment thread .github/workflows/codeql-analysis.yml Outdated
# Manually build the java bytecode
- name: Execute Gradle build
run: ./gradlew assemble
run: ./gradlew assemble -Pcodeql-build

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this conditonal in the sample project, we could limit this script to run the assemble tasks on the library content only. The codeql check is only mandatory for code distributed to our customers' apps

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we can also cover the binaries which can be built in the customer environment by cloning this repository, not only releasable artifacts. With the current change it seems overall CodeQL analysis takes the same time as other stages (the slowest is Bitrise), so at least we are not making overall checks timeline slower.

But yes, we can push it more by ignoring non-releasable content. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Covering the samples and other non releasable contents don't really make sense, as no customer would publish our sample app on the store.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was more thinking about running "bad" binary (even for the sample app) in the customer internal environment, which still have a risk to be exploited.

I will update this PR to build only releasable artifacts.

@codecov-commenter

codecov-commenter commented Jan 9, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.31%. Comparing base (ab7fb40) to head (170b981).
⚠️ Report is 3682 commits behind head on develop.

⚠️ Current head 170b981 differs from pull request most recent head 30b1168

Please upload reports for the commit 30b1168 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1221      +/-   ##
===========================================
+ Coverage    82.30%   82.31%   +0.02%     
===========================================
  Files          353      353              
  Lines        11799    11806       +7     
  Branches      2009     2010       +1     
===========================================
+ Hits          9710     9718       +8     
- Misses        1474     1475       +1     
+ Partials       615      613       -2     

see 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xnm
0xnm force-pushed the nogorodnikov/rumm-2845/speed-up-sample-app-build-for-codeql-scan branch from 170b981 to 30b1168 Compare January 9, 2023 14:00
@0xnm
0xnm marked this pull request as ready for review January 9, 2023 14:12
@0xnm
0xnm requested a review from a team as a code owner January 9, 2023 14:12
@0xnm
0xnm merged commit 6ee23c4 into develop Jan 9, 2023
@0xnm
0xnm deleted the nogorodnikov/rumm-2845/speed-up-sample-app-build-for-codeql-scan branch January 9, 2023 15:36
@xgouchet xgouchet added this to the 1.17.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants