Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Paurikova2
Copy link
Collaborator

@Paurikova2 Paurikova2 commented Apr 28, 2025

Phases MP MM MB MR JM Total
ETA 0 0 0 0 0 0
Developing 2 0 0 0 0 0
Review 0 0 0 0 0 0
Total - - - - - 0
ETA est. 0
ETA cust. - - - - - 0

Problem description

The handle attributes dead and deadSince were not imported.

Summary by CodeRabbit

  • New Features
    • Added support for specifying a "dead" status and the date since a handle is dead when creating or updating handles via the REST API.
    • The REST API now exposes "dead" and "deadSince" fields for handles, allowing users to view and manage these attributes.

@coderabbitai
Copy link

coderabbitai bot commented Apr 28, 2025

Walkthrough

The changes introduce support for tracking the "dead" status and the date since a handle has been dead within the handle management system. This is achieved by adding new dead and deadSince fields to the REST model, updating the service interface and implementation to accept and process these fields, and modifying the REST repository to pass the new parameters during handle creation. No existing logic is altered beyond the inclusion and propagation of these new attributes.

Changes

File(s) Change Summary
dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java Added overloaded createExternalHandle method supporting dead and deadSince parameters; sets these on handle.
dspace-api/src/main/java/org/dspace/handle/service/HandleClarinService.java Added new method signature for createExternalHandle with dead and deadSince parameters to service interface.
dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HandleRest.java Added private fields dead and deadSince with corresponding getters and setters to REST model.
dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HandleRestRepository.java Updated internal call to createExternalHandle to pass dead and deadSince; minor formatting change in method.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant HandleRestRepository
    participant HandleClarinService
    participant Handle

    Client->>HandleRestRepository: Request to create external handle (with dead/deadSince)
    HandleRestRepository->>HandleClarinService: createExternalHandle(context, handleStr, url, dead, deadSince)
    HandleClarinService->>Handle: Create handle object
    HandleClarinService->>Handle: Set dead and deadSince properties
    HandleClarinService->>Handle: Save handle
    HandleClarinService-->>HandleRestRepository: Return handle
    HandleRestRepository-->>Client: Return handle REST representation
Loading

Poem

In the warren of handles, a new tale is spun,
Now "dead" and "deadSince" fields join the run.
With careful new methods, the status is tracked,
REST and service in harmony, nothing lacks.
So hop along, dear coder, with ears held high—
For even old handles get a reason why!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c9057e and 4aee86f.

📒 Files selected for processing (2)
  • dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java (1 hunks)
  • dspace-api/src/main/java/org/dspace/handle/service/HandleClarinService.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • dspace-api/src/main/java/org/dspace/handle/service/HandleClarinService.java
  • dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: dspace-dependencies / docker-build (linux/amd64, ubuntu-latest, true)
  • GitHub Check: Run Integration Tests
  • GitHub Check: Run Unit Tests
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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 anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@Paurikova2 Paurikova2 linked an issue Apr 28, 2025 that may be closed by this pull request
@vidiecan vidiecan requested a review from Copilot May 12, 2025 14:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the "dead" status and "deadSince" date to handle objects in the REST API. Key changes include updating the REST repository to pass new parameters, adding corresponding fields and accessors in the REST model, and overloading the createExternalHandle method in the service layer to handle the additional parameters.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HandleRestRepository.java Updated to invoke the extended createExternalHandle with dead and deadSince parameters.
dspace-server-webapp/src/main/java/org/dspace/app/rest/model/HandleRest.java Added new fields and accessor methods for dead and deadSince.
dspace-api/src/main/java/org/dspace/handle/service/HandleClarinService.java Documented and declared an overloaded createExternalHandle method supporting dead properties.
dspace-api/src/main/java/org/dspace/handle/HandleClarinServiceImpl.java Implemented the overloaded createExternalHandle method setting dead and deadSince properties.
Comments suppressed due to low confidence (1)

dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/HandleRestRepository.java:168

  • The overloaded createExternalHandle method in HandleClarinServiceImpl already calls save, so calling save again in the repository may lead to duplicate persistence operations. Consider removing the redundant save in the repository or adjust the service implementation to align with the expected flow.
handleClarinService.save(context, handle);

@milanmajchrak milanmajchrak merged commit f3921ed into dtq-dev May 13, 2025
11 checks passed
milanmajchrak added a commit that referenced this pull request May 16, 2025
* Fixed browse - the results are not lowercase (#954)

* S3-CESNET direct downloads (#949)

* Return headers for HEAD request - the bitstream download endpoint (#956)

* The bitstream name is encoded in the URL. (#958)

* SWORDv2 issues: Cannot update bitstream of archived Item. The swordv2 url is not composed correctly. Fixed deleting the workspace item when used org.dspace.sword2.WorkflowManagerDefault (#957)

* The file preview process not required username and password in UI (#960)

* Added translation of distribution license for collection to Czech (#952)

* Added dead and deadSince to handle rest (#948)

* Display community and collection handle (#961)

* Embargo during submission not recorded in provenance (#950)

* Allow to access File Downloader for any authorized user (ufal#1199)

* allow.edit.metadata property should also work for submitters that are members of collection SUBMIT subgroup (ufal#1202)

* Prevent error 500 for non admin user uploading file to bundle (ufal#1205)

* Track downloads as pageviews (ufal#1209)

* Loading the bitstreams - performance issue (ufal#1211)
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.

UFAL/The handles does not have migrated dead and dead_since

4 participants