Skip to content

Use Case for File Citation Formats#446

Merged
ekraffmiller merged 12 commits into
developfrom
436-use-cases-of-get-file-citation-in-other-formats
Jun 9, 2026
Merged

Use Case for File Citation Formats#446
ekraffmiller merged 12 commits into
developfrom
436-use-cases-of-get-file-citation-in-other-formats

Conversation

@ChengShi-1

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Files: Added getFileCitationByFormat use case, repository method, and FileCitationFormat enum to support Dataverse file citation exports in EndNote, RIS, BibTeX, CSL, and Internal formats.

Which issue(s) this PR closes:

Related Dataverse PRs:

  • Depends on #

Special notes for your reviewer:

Suggestions on how to test this:

Is there a release notes or changelog update needed for this change?:

Additional documentation:

Copilot AI review requested due to automatic review settings April 28, 2026 19:12
@ChengShi-1 ChengShi-1 linked an issue Apr 28, 2026 that may be closed by this pull request
@github-actions github-actions Bot added the GREI Re-arch GREI re-architecture-related label Apr 28, 2026
@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. Original size: 3 FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) labels Apr 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support in the files domain for exporting a Dataverse file citation in multiple formats (EndNote, RIS, BibTeX, CSL, Internal) by introducing a new FileCitationFormat enum, a getFileCitationByFormat repository method, and a GetFileCitationByFormat use case, with accompanying docs and tests.

Changes:

  • Introduce FileCitationFormat enum and GetFileCitationByFormat use case, and export them from the files module.
  • Implement FilesRepository.getFileCitationByFormat() against /access/datafile/{id}/citation/{format} (stringifying JSON responses when needed).
  • Add unit/integration/functional coverage plus docs + changelog entry.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unit/files/GetFileCitationByFormat.test.ts Unit tests for the new use case behavior (success + error propagation).
test/unit/files/FilesRepository.test.ts Unit tests for the new repository method endpoint + response handling.
test/integration/files/FilesRepository.test.ts Integration coverage against a running Dataverse for each citation export format.
test/functional/files/GetFileCitationByFormat.test.ts Functional (public API) coverage for fetching citations in each format.
test/environment/.env Changes default Dataverse image registry/tag used by the test docker-compose environment.
src/files/infra/repositories/FilesRepository.ts Adds getFileCitationByFormat() implementation.
src/files/index.ts Wires the new use case and exports FileCitationFormat.
src/files/domain/useCases/GetFileCitationByFormat.ts New use case delegating to repository.
src/files/domain/repositories/IFilesRepository.ts Extends the repository interface with getFileCitationByFormat().
src/files/domain/models/FileCitationFormat.ts New enum defining supported export formats (API path values).
docs/useCases.md Adds documentation section and example usage for the new use case.
CHANGELOG.md Adds an “Added” entry describing the new feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/environment/.env Outdated
Comment thread docs/useCases.md Outdated
@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project Apr 28, 2026
@cmbz cmbz added the FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) label May 6, 2026
@cmbz cmbz added the FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) label May 21, 2026
ChengShi-1 and others added 3 commits May 26, 2026 15:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ChengShi-1 ChengShi-1 self-assigned this May 28, 2026
@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Progress 💻 in IQSS Dataverse Project May 28, 2026
@ChengShi-1 ChengShi-1 removed their assignment May 28, 2026
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project May 28, 2026
@cmbz cmbz added the FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) label Jun 3, 2026
@ekraffmiller ekraffmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jun 5, 2026
@ekraffmiller ekraffmiller self-assigned this Jun 8, 2026

@ekraffmiller ekraffmiller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Some comments about the tests. Also, can you resolve the merge conflicts?

Comment thread test/unit/files/FilesRepository.test.ts Outdated
}
)

test('should authenticate via session cookie when configured', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know we have these tests for session cookie auth in other places, but since we've switched from session cookies to Bearer tokens in the frontend, I don't think we need to keep adding these tests.

})
})

describe('getFileCitationByFormat', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this use case takes a fileId or a persistentId, can you add a test that uses persistentId?

ChengShi-1 and others added 3 commits June 8, 2026 18:01
list enum  values in documentation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@ekraffmiller ekraffmiller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, approved

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jun 9, 2026
@ekraffmiller ekraffmiller merged commit eb0cae7 into develop Jun 9, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Merged 🚀

Development

Successfully merging this pull request may close these issues.

Use Cases of Get File Citation In Other Formats

4 participants