Skip to content

Refactor Archiver Client for large requests#196

Merged
jacomago merged 7 commits intoChannelFinder:masterfrom
jacomago:archclient-large-input
Feb 18, 2026
Merged

Refactor Archiver Client for large requests#196
jacomago merged 7 commits intoChannelFinder:masterfrom
jacomago:archclient-large-input

Conversation

@jacomago
Copy link
Contributor

@jacomago jacomago commented Feb 11, 2026

Refactored the Archiver Client to make sure it can stream large requests.
Swapped to the Spring boot RestClient
Added a test ArchiverServiceTest
Reduced the scope of the AAProcessorIT tests to mock the ArchiverService

For future I'd like to use openapi definition from the archiver to generate a client, maybe that's a good codathon ticket.

@shroffk
Copy link
Collaborator

shroffk commented Feb 11, 2026

This does sound like a good codeathon task

@jacomago jacomago force-pushed the archclient-large-input branch from f0f092d to 1edb6fe Compare February 11, 2026 16:04
@jacomago jacomago marked this pull request as draft February 12, 2026 07:16
@jacomago jacomago force-pushed the archclient-large-input branch from 1edb6fe to e9679d1 Compare February 12, 2026 15:01
@jacomago jacomago self-assigned this Feb 12, 2026
@jacomago jacomago marked this pull request as ready for review February 12, 2026 16:08
Copy link
Collaborator

@georgweiss georgweiss left a comment

Choose a reason for hiding this comment

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

Had some Spring Boot related comments....

@jacomago jacomago force-pushed the archclient-large-input branch from e9679d1 to 22427d3 Compare February 13, 2026 17:09
This was used to distinguish support for getting status via post or query
Now (from an earlier merge) we explicitly configure it instead.
@jacomago jacomago force-pushed the archclient-large-input branch 3 times, most recently from 8ed48ac to 3eac53e Compare February 16, 2026 14:04
georgweiss
georgweiss previously approved these changes Feb 16, 2026
Adds Validation checking of responses from ArchiveAction s
Adds a test for ArchiverService with some example responses from a live archiver
@jacomago jacomago force-pushed the archclient-large-input branch 2 times, most recently from 76bb0e8 to 1e24b36 Compare February 17, 2026 07:27
Means the integration tests won't try to autowire it
@jacomago jacomago force-pushed the archclient-large-input branch from 1e24b36 to 778ad1a Compare February 17, 2026 11:51
@sonarqubecloud
Copy link

@jacomago
Copy link
Contributor Author

I think the failures are now due to some broken docker changes in github actions and this PR is ready @anderslindho

Copy link
Contributor

@anderslindho anderslindho left a comment

Choose a reason for hiding this comment

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

LGTM, but - as mentioned before - would be nice if your commit messages focused more on the "why"

To come up with thoughtful commits, consider the following:

  • Why have I made these changes?
  • What effect have my changes made?
  • Why was the change needed?
  • What are the changes in reference to?
    Assume the reader does not understand what the commit is addressing. They may not have access to the story addressing the detailed background of the change.

https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/

public ArchiverService(
RestClient.Builder builder, @Value("${aa.timeout_seconds:15}") int timeoutSeconds) {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(timeoutSeconds * 1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Magic value: put 1000 in a named variable

private List<Map<String, String>> sendRequest(Object payload, String uriString) {
try {
String response =
String values = objectMapper.writeValueAsString(payload);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should prob be outside of try-except 🔧


public long configureAA(Map<ArchiveAction, List<ArchivePVOptions>> archivePVS, String aaURL)
throws JsonProcessingException {
List<String> submitArchiveAction(List<String> pvs, List<ArchivePVOptions> payload, String aaURL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should maybe be more careful with how we use the terms "record", "record name", "pv", "pv name" - these are all slightly different 💭

ArchiveAction(final String endpoint) {
ArchiveAction(final String endpoint, final String successfulStatus) {
this.endpoint = endpoint;
this.successfulStatus = successfulStatus;
Copy link
Contributor

Choose a reason for hiding this comment

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

successMessage? 🔧

@jacomago jacomago merged commit 8656e42 into ChannelFinder:master Feb 18, 2026
6 of 9 checks passed
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.

4 participants

Comments