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

Integrated code lifecycle: Allow admins to set build timeout options via application properties #9603

Merged

Conversation

BBesrour
Copy link
Member

@BBesrour BBesrour commented Oct 26, 2024

Require a config change

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).

Motivation and Context

This PR allows admins to adjust the timeout options in the UI.
New properties are added:

  • artemis.continuous-integration.build-timeout-seconds.min: Min timeout option
  • artemis.continuous-integration.build-timeout-seconds.max: Max timeout option (if the user somehow sends a value higher than this, it will be checked and overridden)
  • artemis.continuous-integration.build-timeout-seconds.default: default option

Steps for Testing

Prerequisites:

  • 1 Instructor
  • Test server with ICL
  1. Go to exercise creation, open dev tools
  2. Check Customize build script
  3. Make sure the default value of the timeout is 120 (default value), and that the max and min are respectively 240 and 10.
  4. Save exercise
  5. In the dev tools, check that the timeout was set correctly

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

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
programming-exercise-build-configuration.component.ts 95% ✅ ❌
profile-info.model.ts 100%
profile.service.ts 92.94% ✅ ❌

Screenshots

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced build job management with increased timeout settings (default updated to 240 seconds).
    • Added configurable timeout options for instructor builds, including minimum, maximum, and default values.
    • Dynamic binding for timeout settings in the programming exercise build configuration component.
    • Expanded profile information to include build timeout settings for better management.
    • Introduced a new section in documentation for configuring build timeout settings.
    • Restructured user documentation for programming exercise setup, including a new section on editing maximum build duration.
  • Bug Fixes

    • Improved error handling during build job execution, particularly for cancellations.
  • Tests

    • Enhanced test coverage for the programming exercise build configuration component, validating timeout initialization logic based on profile information.

@BBesrour BBesrour self-assigned this Oct 26, 2024
@BBesrour BBesrour requested a review from a team as a code owner October 26, 2024 20:23
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. buildagent Pull requests that affect the corresponding module core Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module labels Oct 26, 2024
Copy link

coderabbitai bot commented Oct 26, 2024

Walkthrough

The pull request introduces several changes primarily focused on timeout configurations for build jobs within the application. Key modifications include updating the default timeout value in the BuildJobManagementService, adding new constants for instructor build timeouts, and enhancing the LocalCIInfoContributor to include these timeout options. Additionally, the Angular component for managing programming exercise build configurations has been updated to dynamically bind timeout values, and the ProfileInfo model and ProfileService have been extended to accommodate new timeout properties.

Changes

File Change Summary
src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobManagementService.java - Updated timeoutSeconds from 120 to 240 seconds.
- Modified logic for buildJobTimeoutSeconds to check if timeoutSeconds is greater than 0.
- Enhanced error handling for CompletionException.
src/main/java/de/tum/cit/aet/artemis/core/config/Constants.java - Added constants: INSTRUCTOR_BUILD_TIMEOUT_MIN_OPTION, INSTRUCTOR_BUILD_TIMEOUT_MAX_OPTION, INSTRUCTOR_BUILD_TIMEOUT_DEFAULT_OPTION.
src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIInfoContributor.java - Added fields: minInstructorBuildTimeoutOption, maxInstructorBuildTimeoutOption, defaultInstructorBuildTimeoutOption, all annotated with @Value.
src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.html - Updated <input type="range"> attributes to use dynamic bindings for min, max, and default values.
src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.ts - Implemented OnInit interface.
- Added profileService property.
- Introduced optional properties: timeoutMinValue, timeoutMaxValue, timeoutDefaultValue.
- Implemented ngOnInit method.
src/main/webapp/app/shared/layouts/profiles/profile-info.model.ts - Added properties: buildTimeoutMin, buildTimeoutMax, buildTimeoutDefault to ProfileInfo.
src/main/webapp/app/shared/layouts/profiles/profile.service.ts - Updated getProfileInfo method to assign values to buildTimeoutMin, buildTimeoutMax, and buildTimeoutDefault in ProfileInfo.
src/test/javascript/spec/component/programming-exercise/programming-exercise-build-configuration.component.spec.ts - Added mock implementation of ProfileService and new test case for ngOnInit method to verify timeout options initialization.
docs/admin/setup/programming-exercises.rst - Added section on "Timeout Options" for configuring build timeout settings.
docs/user/exercises/programming-exercise-setup.inc - Restructured content and added new section "Edit Maximum Build Duration" for setting time limits on build plans.

Possibly related PRs

Suggested labels

component:Programming, component:integrated code lifecycle, priority:high

Suggested reviewers

  • SimonEntholzer
  • florian-glombik
  • JohannesWt
  • az108

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (8)
src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.ts (2)

Line range hint 12-24: Consider enhancing form validation for timeout field.

While the input/output declarations look good, consider adding form validation to ensure the timeout value stays within the min/max bounds.

timeoutField = viewChild<NgModel>('timeoutField', {
    validators: [
        Validators.min(this.timeoutMinValue ?? 10),
        Validators.max(this.timeoutMaxValue ?? 240)
    ]
});

25-28: Consider making timeout configuration properties readonly.

Since these properties are only set during initialization, they should be marked as readonly to prevent accidental modifications.

-    timeoutMinValue?: number;
-    timeoutMaxValue?: number;
-    timeoutDefaultValue?: number;
+    private readonly timeoutMinValue?: number;
+    private readonly timeoutMaxValue?: number;
+    private readonly timeoutDefaultValue?: number;
src/main/webapp/app/shared/layouts/profiles/profile-info.model.ts (1)

40-42: Add JSDoc documentation for the new timeout properties.

Consider adding JSDoc comments to document the purpose and constraints of these properties, making it easier for other developers to understand their usage.

+    /** Minimum allowed build timeout in seconds (e.g., 10) */
     public buildTimeoutMin?: number;
+    /** Maximum allowed build timeout in seconds (e.g., 360) */
     public buildTimeoutMax?: number;
+    /** Default build timeout in seconds if not specified (e.g., 120) */
     public buildTimeoutDefault?: number;
src/main/webapp/app/shared/layouts/profiles/profile.service.ts (1)

91-93: Consider grouping related properties together.

The build timeout properties are conceptually related but are added at the end of the mapping block. Consider grouping them with other build-related properties for better code organization.

Move these properties near the buildPlanURLTemplate assignment for better code organization:

                         profileInfo.buildPlanURLTemplate = data.buildPlanURLTemplate;
+                        // Build timeout configuration
+                        profileInfo.buildTimeoutMin = data.buildTimeoutMin;
+                        profileInfo.buildTimeoutMax = data.buildTimeoutMax;
+                        profileInfo.buildTimeoutDefault = data.buildTimeoutDefault;
                         profileInfo.commitHashURLTemplate = data.commitHashURLTemplate;
src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobManagementService.java (2)

Line range hint 155-159: Enhance timeout validation logic.

While the maximum timeout check is implemented, the logic is missing validation for the minimum timeout value (10 seconds) mentioned in the PR objectives. Also, the condition could be more readable if split.

Consider applying this change for better readability and complete validation:

-        if (buildJobItem.buildConfig().timeoutSeconds() > 0 && buildJobItem.buildConfig().timeoutSeconds() < this.timeoutSeconds) {
+        int requestedTimeout = buildJobItem.buildConfig().timeoutSeconds();
+        if (requestedTimeout < 10) {  // Minimum timeout
+            buildJobTimeoutSeconds = 10;
+        } else if (requestedTimeout > this.timeoutSeconds) {  // Maximum timeout
+            buildJobTimeoutSeconds = this.timeoutSeconds;
+        } else {
             buildJobTimeoutSeconds = buildJobItem.buildConfig().timeoutSeconds();
-        }
-        else {
-            buildJobTimeoutSeconds = this.timeoutSeconds;
         }

Line range hint 1-284: Consider extracting timeout configuration to a dedicated class.

The BuildJobManagementService handles multiple responsibilities. To improve maintainability and follow the Single Responsibility Principle, consider extracting the timeout configuration into a dedicated @ConfigurationProperties class.

Example implementation:

@ConfigurationProperties(prefix = "artemis.continuous-integration.build-timeout-seconds")
@Validated
public record BuildTimeoutConfig(
    @Min(10) int min,
    @Max(360) int max,
    @Min(10) @Max(360) int defaultValue
) {
    public BuildTimeoutConfig {
        if (min > max) {
            throw new IllegalArgumentException("min timeout cannot be greater than max timeout");
        }
        if (defaultValue < min || defaultValue > max) {
            throw new IllegalArgumentException("default timeout must be between min and max");
        }
    }
}

This approach would:

  1. Centralize timeout configuration
  2. Add validation at startup
  3. Make the configuration more maintainable
  4. Reduce the responsibilities of BuildJobManagementService
src/main/java/de/tum/cit/aet/artemis/core/config/Constants.java (2)

275-280: Add JavaDoc documentation for the new timeout constants.

While the implementation is correct, adding JavaDoc documentation would improve maintainability by explaining:

  • The purpose of each constant
  • The relationship with application properties
  • Any constraints or considerations for their usage

Add documentation like this:

+    /**
+     * Property key for the minimum build timeout value in seconds that can be configured by instructors.
+     * Maps to artemis.continuous-integration.build-timeout-seconds.min in application properties.
+     */
     public static final String INSTRUCTOR_BUILD_TIMEOUT_MIN_OPTION = "buildTimeoutMin";

+    /**
+     * Property key for the maximum build timeout value in seconds that can be configured by instructors.
+     * Maps to artemis.continuous-integration.build-timeout-seconds.max in application properties.
+     */
     public static final String INSTRUCTOR_BUILD_TIMEOUT_MAX_OPTION = "buildTimeoutMax";

+    /**
+     * Property key for the default build timeout value in seconds used when no specific timeout is configured.
+     * Maps to artemis.continuous-integration.build-timeout-seconds.default in application properties.
+     */
     public static final String INSTRUCTOR_BUILD_TIMEOUT_DEFAULT_OPTION = "buildTimeoutDefault";

275-280: Consider grouping CI-related constants.

For better code organization, consider adding a separator comment to group these constants with other CI-related constants like INFO_BUILD_PLAN_URL_DETAIL.

Add a section comment like this:

+    // Constants for CI build configuration
     public static final String INSTRUCTOR_BUILD_TIMEOUT_MIN_OPTION = "buildTimeoutMin";
     public static final String INSTRUCTOR_BUILD_TIMEOUT_MAX_OPTION = "buildTimeoutMax";
     public static final String INSTRUCTOR_BUILD_TIMEOUT_DEFAULT_OPTION = "buildTimeoutDefault";
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6e1c562 and f588b44.

⛔ Files ignored due to path filters (2)
  • src/main/resources/config/application-buildagent.yml is excluded by !**/*.yml
  • src/main/resources/config/application-localci.yml is excluded by !**/*.yml
📒 Files selected for processing (7)
  • src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobManagementService.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/core/config/Constants.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIInfoContributor.java (2 hunks)
  • src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.html (1 hunks)
  • src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.ts (2 hunks)
  • src/main/webapp/app/shared/layouts/profiles/profile-info.model.ts (1 hunks)
  • src/main/webapp/app/shared/layouts/profiles/profile.service.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobManagementService.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/core/config/Constants.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/LocalCIInfoContributor.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/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/layouts/profiles/profile-info.model.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/layouts/profiles/profile.service.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

🔇 Additional comments (7)
src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.ts (2)

1-9: LGTM! Component follows Angular style guide.

The imports are well-organized and the component follows Angular naming conventions.


10-11: LGTM! Modern dependency injection approach.

Good use of the new inject() function for dependency injection, which is more tree-shakable than constructor injection.

src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIInfoContributor.java (1)

5-5: LGTM!

The Value annotation import is properly added and follows the coding guidelines.

src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.html (2)

Line range hint 18-18: LGTM! Correct usage of new Angular control flow syntax.

The template correctly uses the new @if directive instead of *ngIf, following the latest Angular guidelines.


Line range hint 31-38: Consider adding validation for timeout values.

Based on the PR objectives, there should be specific constraints:

  • Minimum: 10 seconds
  • Maximum: 360 seconds
  • Default: 120 seconds

Consider adding validation to ensure these constraints are enforced in the UI.

Let's verify if these constraints are properly defined in the component:

Would you like me to provide an implementation for the validation logic?

✅ Verification successful

Basic validation exists but can be enhanced for better user experience

The code already implements the basic constraints through HTML5 attributes:

  • min and max attributes are properly bound to timeoutMinValue and timeoutMaxValue
  • These values are correctly initialized from profile info with appropriate fallbacks (10s min, 240s max, 120s default)
  • The input is marked as required

However, the validation could be enhanced by:

  • Adding visual feedback when values are out of range
  • Implementing a custom validator to ensure the value stays within bounds even with direct input
  • Adding error messages to guide users when invalid values are entered

Example implementation:

@Directive({
  selector: '[timeoutValidator]'
})
export class TimeoutValidatorDirective implements Validator {
  validate(control: AbstractControl): ValidationErrors | null {
    const value = control.value;
    if (value < this.timeoutMinValue || value > this.timeoutMaxValue) {
      return { range: true };
    }
    return null;
  }
}
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if timeout constraints are properly defined in the component
# Expected: Find constant definitions or property assignments matching the specified values

# Search for timeout-related constant definitions or property assignments
rg -A 5 "(timeoutMinValue|timeoutMaxValue|timeoutDefaultValue)" --type ts

Length of output: 4069


Script:

#!/bin/bash
# Let's check if there are any validation mechanisms in place for the timeout values
# Search for validation-related code in the component and its template

# Search for validation-related code in the component
rg -A 5 "timeoutChange|timeout\(" --type ts src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/

# Search for any validation directives in the template
rg "min=|max=|required|validate" src/main/webapp/app/exercises/programming/manage/update/update-components/custom-build-plans/programming-exercise-build-configuration/programming-exercise-build-configuration.component.html

Length of output: 3050

src/main/webapp/app/shared/layouts/profiles/profile-info.model.ts (1)

40-42: LGTM! Properties are well-structured and follow conventions.

The new timeout properties are:

  • Properly typed as optional numbers
  • Follow camelCase naming convention
  • Logically grouped with other CI-related properties
  • Align with the PR objectives for configurable timeout settings
src/main/webapp/app/shared/layouts/profiles/profile.service.ts (1)

91-93: Verify the integration with ProfileInfo model.

Ensure that these new properties are properly defined in the ProfileInfo model with appropriate types.

Let's verify the ProfileInfo model definition:

✅ Verification successful

Based on the gathered information, I can now provide a final response:

The buildTimeout properties are properly defined in the ProfileInfo model

The properties buildTimeoutMin, buildTimeoutMax, and buildTimeoutDefault are correctly defined in the ProfileInfo model (src/main/webapp/app/shared/layouts/profiles/profile-info.model.ts) as optional number properties. These properties are:

  • Properly mapped in the profile service from the server response
  • Used with appropriate fallback values in the build configuration component:
    • buildTimeoutMin: defaults to 10
    • buildTimeoutMax: defaults to 240
    • buildTimeoutDefault: defaults to 120
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for ProfileInfo model definition
rg -t typescript "class ProfileInfo" -A 10

Length of output: 79


Script:

#!/bin/bash
# Search for ProfileInfo definition using ripgrep without file type restriction
rg "ProfileInfo" -A 10

Length of output: 303867


Script:

#!/bin/bash
# Use fd to find TypeScript files and search for ProfileInfo
fd -e ts -x rg "ProfileInfo" -A 10 {}

Length of output: 109183


Script:

#!/bin/bash
# Search for interface or type definition of ProfileInfo
rg "(interface|type) ProfileInfo" -A 10

Length of output: 41


Script:

#!/bin/bash
# Search for files containing ProfileInfo in their name
fd "ProfileInfo"

Length of output: 16


Script:

#!/bin/bash
# Search for ProfileInfo class definition and its properties
rg "class ProfileInfo" -A 30

Length of output: 3232


Script:

#!/bin/bash
# Search for files containing profile-info in their name
fd "profile-info"

Length of output: 144


Script:

#!/bin/bash
# Search for buildTimeout related properties in any TypeScript files
rg "buildTimeout(Min|Max|Default)" -t ts

Length of output: 1576

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 26, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test2.artemis.cit.tum.de" is already in use by PR #9604.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 26, 2024
@HawKhiem HawKhiem added deploy:artemis-test4 and removed deployment-error Added by deployment workflows if an error occured labels Oct 26, 2024
@HawKhiem HawKhiem temporarily deployed to artemis-test4.artemis.cit.tum.de October 26, 2024 22:29 — with GitHub Actions Inactive
Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test3.artemis.cit.tum.de" is already in use by PR #9583.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 30, 2024
@SindiBuklaji SindiBuklaji added deploy:artemis-test3 and removed deployment-error Added by deployment workflows if an error occured labels Oct 30, 2024
@SindiBuklaji SindiBuklaji temporarily deployed to artemis-test3.artemis.cit.tum.de October 30, 2024 20:04 — with GitHub Actions Inactive
Copy link

@SindiBuklaji SindiBuklaji left a comment

Choose a reason for hiding this comment

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

Tested on Ts3 and everything worked as described 👍

Copy link

@kevinfischer4 kevinfischer4 left a comment

Choose a reason for hiding this comment

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

Tested on TS2. The timeout can be set to a value between 10 and 240. Works as expected.

Copy link

@sawys777 sawys777 left a comment

Choose a reason for hiding this comment

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

Tested on TS1. Everything worked as expected and the range of timeout was correct as well.

@krusche krusche changed the title Integrated code lifecycle: Allow admins to set timeout options via application properties Integrated code lifecycle: Allow admins to set build timeout options via application properties Nov 2, 2024
@krusche krusche added this to the 7.6.5 milestone Nov 2, 2024
@krusche krusche merged commit 4954074 into develop Nov 2, 2024
113 of 122 checks passed
@krusche krusche deleted the chore/integrated-code-lifecycle/change-timeout-options branch November 2, 2024 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildagent Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. core Pull requests that affect the corresponding module documentation programming Pull requests that affect the corresponding module ready for review ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.