-
Notifications
You must be signed in to change notification settings - Fork 303
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
: Improve flexibility of authentication methods in the code popup
#10147
base: develop
Are you sure you want to change the base?
Programming exercises
: Improve flexibility of authentication methods in the code popup
#10147
Conversation
…re/update-angular19
…re/update-angular19
…re/update-angular19
…re/update-angular19
…re/update-angular19
To fix pdf-preview-enlarged-canvas.component.spec.ts tests and pdf-preview-thumbnail-grid.component.spec.ts tests
…re/update-angular19
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.
Code. Thanks for implementing my suggestions!
0bd00f0
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: 1
🧹 Nitpick comments (2)
src/test/java/de/tum/cit/aet/artemis/programming/icl/LocalVCInfoContributorTest.java (2)
16-21
: Enhance test method clarity and maintainability.
The test method name
testContribute
is too generic. Consider renaming it to describe the specific behavior being tested, e.g.,shouldContributeAuthenticationMechanismsToInfo
.Consider extracting the authentication mechanisms list as a constant or documenting why these specific values were chosen:
private static final List<String> EXPECTED_AUTHENTICATION_MECHANISMS = List.of("password", "token", "ssh");
- The use of reflection might indicate that
orderedAuthenticationMechanisms
should be passed through the constructor or a setter method instead.
29-29
: Enhance assertion specificity and error messages.The current assertion could be more robust. Consider:
assertThat(info.getDetails()) .as("Info details should not be null") .isNotNull() .containsKey("authenticationMechanisms"); assertThat(info.getDetails().get("authenticationMechanisms")) .as("Authentication mechanisms should match the configured values") .isNotNull() .isInstanceOf(List.class) .asList() .containsExactlyElementsOf(authenticationMechanisms);This provides:
- Null checks
- Type verification
- More descriptive error messages
- Exact list comparison
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/test/java/de/tum/cit/aet/artemis/programming/icl/LocalVCInfoContributorTest.java
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/test/java/de/tum/cit/aet/artemis/programming/icl/LocalVCInfoContributorTest.java (1)
Pattern src/test/java/**/*.java
: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: server-tests
- GitHub Check: client-tests-selected
- GitHub Check: client-tests
- GitHub Check: client-style
- GitHub Check: server-style
- GitHub Check: Build and Push Docker Image
- GitHub Check: Build .war artifact
- GitHub Check: Analyse
🔇 Additional comments (1)
src/test/java/de/tum/cit/aet/artemis/programming/icl/LocalVCInfoContributorTest.java (1)
Line range hint
1-13
: LGTM! Clean imports and proper class structure.The imports are well-organized, and the test class follows proper naming conventions.
src/test/java/de/tum/cit/aet/artemis/programming/icl/LocalVCInfoContributorTest.java
Show resolved
Hide resolved
The API is still accessible for Instructors and Teaching Assistants, right? Because we rely on this API. |
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.
Code reapprove 👍
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.
re-approve
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.
Re-approve
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.
code re-approve
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.
Programming exercises
: Improve code buttonProgramming exercises
: Improve flexibility of authentication methods in the code popup
@Value("${artemis.version-control.use-version-control-access-token:false}") | ||
private boolean useVcsAccessToken; | ||
|
||
@Value("${artemis.version-control.show-clone-url-without-token:true}") |
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.
application-localvc.yml
still refers to the old now unused values, rather than the single new one.
Checklist
General
Server
Client
Changes affecting Programming Exercises
Motivation and Context
The code-button code is quite complex and bug prone.
Description
Fixes #9972
Adds the following features:
['password', 'ssh', 'token']
. The code button will also show these mechanisms in that order.courses
andcourse-management
routes. Forcourse
routes, the code-button uses the participation token, as this is the students view. For the instructor view, it always uses the user token.Steps for Testing
Prerequisites:
Exam Mode Testing
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
Test Coverage
Client
Screenshots
E.g. authentication set to
['ssh', 'token']
, so the password/https option is not available:Summary by CodeRabbit
Release Notes
Authentication
User Interface
Localization
Access Control
These changes enhance the authentication and repository access mechanisms, providing more flexible and streamlined user interactions.