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

Development: Inline endpoint constants #8438

Merged
merged 21 commits into from
Apr 27, 2024
Merged

Conversation

Strohgelaender
Copy link
Contributor

@Strohgelaender Strohgelaender commented Apr 19, 2024

Checklist

General

Motivation and Context

Some endpoints use concatenated string constants as their URL. This can make these endpoints harder to find when using a typically search function as a developer. We want to therefore use string literals when defining the endpoint url.

Description

This PR uses the automatic IntelliJ refactoring tools to inline these constants. I then went over these changes and cleaned up instances like "/api/programming-exercises/import/{sourceExerciseId}".replace("{sourceExerciseId}", sourceExercise.getId().toString()) to "/api/programming-exercises/import/" + sourceExercise.getId().
You can review the PR commit by commit to see the process.

Steps for Testing

code review

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Summary by CodeRabbit

  • New Features

    • Improved endpoint paths for better navigation and clarity in API interactions.
    • Enhanced maintainability and readability with direct path definitions in annotations.
  • Bug Fixes

    • Corrected path concatenations for file access and API calls in test suites.
  • Refactor

    • Consolidated and simplified request mappings.
    • Removed outdated constants and used direct strings in endpoint definitions.
  • Tests

    • Updated test methods to align with new endpoint structures and enhanced setup logic for programming exercises.
    • Improved test readability and maintainability through updated endpoint paths and imports.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) labels Apr 19, 2024
@Strohgelaender Strohgelaender marked this pull request as ready for review April 19, 2024 11:00
@Strohgelaender Strohgelaender requested a review from a team as a code owner April 19, 2024 11:00

This comment was marked as spam.

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: 34

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 19, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 20, 2024
julian-christl
julian-christl previously approved these changes Apr 21, 2024
Copy link
Member

@julian-christl julian-christl left a comment

Choose a reason for hiding this comment

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

looks good, thank you!

JohannesStoehr
JohannesStoehr previously approved these changes Apr 21, 2024
Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Looks good now

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 21, 2024
@Strohgelaender Strohgelaender added this to the 7.0.1 milestone Apr 21, 2024
@krusche krusche modified the milestones: 7.0.1, 7.0.2 Apr 22, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Apr 26, 2024
JohannesStoehr
JohannesStoehr previously approved these changes Apr 26, 2024
Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Reapprove after Merge

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: 0

Out of diff range and nitpick comments (4)
src/main/webapp/app/exercises/quiz/manage/apollon-diagrams/apollon-diagram-create-form.component.ts (1)

Line range hint 23-23: The save method correctly handles the diagram creation logic. However, consider adding loading indicators or disabling form elements during the save operation to improve user feedback and prevent duplicate submissions.

src/main/webapp/app/admin/standardized-competencies/import/admin-import-standardized-competencies.component.ts (1)

Line range hint 31-31: The importCompetencies method handles the API call for importing competencies. Consider implementing error handling and user feedback mechanisms to enhance the robustness of the import process.

src/main/webapp/app/exercises/quiz/manage/apollon-diagrams/apollon-diagram-detail.component.ts (1)

Line range hint 39-39: The saveDiagram method handles the saving of the diagram state. Consider adding more robust error handling and user feedback mechanisms to improve the reliability of the save operation.

src/test/java/de/tum/in/www1/artemis/authorization/AuthorizationTestService.java (1)

Line range hint 79-79: The testEndpoint method is a wrapper for specific tests on a single endpoint. This method should be expanded to include more comprehensive tests based on the application's security requirements.

julian-christl
julian-christl previously approved these changes Apr 26, 2024
Copy link
Member

@julian-christl julian-christl left a comment

Choose a reason for hiding this comment

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

reapprove code

Copy link
Member

@julian-christl julian-christl left a comment

Choose a reason for hiding this comment

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

Reapprove code

@krusche krusche modified the milestones: 7.0.2, 7.0.3 Apr 26, 2024
@krusche krusche merged commit 31105b4 into develop Apr 27, 2024
28 of 31 checks passed
@krusche krusche deleted the chore/inline-endpoints branch April 27, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) documentation ready for review server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants