-
Notifications
You must be signed in to change notification settings - Fork 301
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
Programming exercises
: Fix programming language feature flags
#10110
Programming exercises
: Fix programming language feature flags
#10110
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 pmd (7.8.0)src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.javaThe following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration. src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.javaThe following rules are missing or misspelled in your ruleset file category/vm/bestpractices.xml: BooleanInstantiation, DontImportJavaLang, DuplicateImports, EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer, EmptyStatementBlock, EmptyStatementNotInLoop, EmptySwitchStatements, EmptySynchronizedBlock, EmptyTryBlock, EmptyWhileStmt, ExcessiveClassLength, ExcessiveMethodLength, ImportFromSamePackage, MissingBreakInSwitch, SimplifyBooleanAssertion. Please check your ruleset configuration. WalkthroughThe pull request involves modifications to two programming language feature services: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (1)
49-49
: Check consistency for KOTLIN feature flags.Similar to JAVA, ensure that the newly set
false
aligns with the intended support level for Kotlin in Jenkins. This setting can help avoid confusion if other parts of the codebase expect auxiliary repository support to be enabled.You may wish to unify the logic for enabling and disabling auxiliary repositories by referencing a shared configuration or feature toggle if this setting is frequently changed.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java
(1 hunks)src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (1)
Pattern src/main/java/**/*.java
: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1)
Pattern src/main/java/**/*.java
: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports
📓 Learnings (2)
src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (2)
Learnt from: magaupp
PR: ls1intum/Artemis#9256
File: src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java:0-0
Timestamp: 2024-11-12T12:52:03.805Z
Learning: In `JenkinsProgrammingLanguageFeatureService.java`, comments explaining boolean flags in calls to the `ProgrammingLanguageFeature` constructor are unnecessary because the parameter names are clear, and most IDEs display them as inline hints.
Learnt from: magaupp
PR: ls1intum/Artemis#8802
File: src/main/java/de/tum/in/www1/artemis/service/connectors/jenkins/JenkinsProgrammingLanguageFeatureService.java:43-43
Timestamp: 2024-11-12T12:51:58.050Z
Learning: Jenkins support for Rust was added in commit d0fb7032e70c001dc8b2c4d0a391ca8bf7e7d586.
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1)
Learnt from: magaupp
PR: ls1intum/Artemis#9261
File: src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java:43-55
Timestamp: 2024-11-12T12:51:40.391Z
Learning: For constructors with multiple boolean parameters, it's acceptable to keep them as is because parameter names are clear and IDEs provide inline hints, making the code readable without refactoring to the builder pattern.
🔇 Additional comments (2)
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java (1)
46-63
: Confirm reintroduction ofauxiliaryRepositoriesSupported
for all languages.All these lines set the last constructor parameter to
true
, re-enabling auxiliary repository support for each language. This change aligns with the PR goal to revert and restore the previous feature flags. However, please verify each language’s settings to ensure the flags accurately reflect the intended behavior. If some of these languages are not supposed to support auxiliary repositories, consider reverting them tofalse
.src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java (1)
47-47
: Confirm auxiliary repository support setting for JAVA.The last parameter presumably indicates auxiliary repository support (or a similar feature). Verify that
false
is correct for Jenkins, aligning with the PR objective to disable auxiliary repositories for this service.Run the following command to confirm no contradictions with older definitions or calls that assume auxiliary repository support for Java on Jenkins:
✅ Verification successful
Auxiliary repository support correctly disabled for Java in Jenkins service
The verification confirms that setting
auxiliaryRepositoriesSupported
tofalse
for Java is correct and consistent with all other languages in the Jenkins service implementation. This aligns with the PR objective to disable auxiliary repositories for this service.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for references to auxiliaryRepositoriesSupported in Jenkins contexts for Java rg -A 5 'programmingLanguageFeatures\.put\(JAVA.+auxiliaryRepositoriesSupported'Length of output: 82
Script:
#!/bin/bash # Find and show ProgrammingLanguageFeature class definition ast-grep --pattern 'class ProgrammingLanguageFeature { $$$ }' # Search for auxiliary repository related code in Jenkins context rg -i "auxiliary.*repository.*jenkins" -A 3 # Search for Java configurations in Jenkins services rg "JAVA.*Jenkins" -A 3Length of output: 1794
Script:
#!/bin/bash # Search for auxiliary repository references in Jenkins service files rg -g "**/*Jenkins*.java" -i "auxiliary.*repository" -A 3 # Find ProgrammingLanguageFeature usage in Jenkins context rg -g "**/*Jenkins*.java" "ProgrammingLanguageFeature" -A 3 # Search for configuration properties related to auxiliary repositories rg -g "**/*.properties" -g "**/*.yml" -i "auxiliary.*repository"Length of output: 10669
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the reviews. @ahbitaqu There hasn't been a checkmark for SCA in the Detail view before, but I can easily add one |
Thanks for the fix 👍 |
Checklist
General
Server
Changes affecting Programming Exercises
Motivation and Context
#9993 removed testwise coverage support and its
testwiseCoverageAnalysisSupported
flag from theProgrammingLanguageFeature
record.The
ProgrammingLanguageFeatureService
implementations were incorrectly updated to remove the last parameter to theProgrammingLanguageFeature
record (auxiliaryRepositoriesSupported
), while thetestwiseCoverageAnalysisSupported
parameter is the second to last.The recent addition of Python static code analysis was also reverted.
As a result auxiliary repository support on LocalCI was mostly disabled. On Jenkins auxiliary repository support was enabled where it was not supported.
Description
This PR restores the supported features as they were before.
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Summary by CodeRabbit