Skip to content

Conversation

VihasMakwana
Copy link
Contributor

This PR finalizes the archive implementation and adds test case.

@djaglowski I think we can add more sophisticated test cases once we establish common ground on the implementation.

Relates: #38056

@VihasMakwana
Copy link
Contributor Author

VihasMakwana commented Feb 28, 2025

One thing remains i.e. to update Config struct to allow polls_to_archive to be unmarshalled. I think we can do that in documentation PR afterwards.

EDIT: as of now, this PR includes documentation and enabled the config. If needed, we can separate it out.

@VihasMakwana VihasMakwana added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 28, 2025
@VihasMakwana
Copy link
Contributor Author

I'll add changelog in documentation PR, as that will enable the actual config.

Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

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

Reviewing this PR was hard for me due to the complexity of the code. I'm worried that the code is getting even more complex with these changes. We should work on decreasing its complexity in future contributions.

maxBatches: c.MaxBatches,
telemetryBuilder: telemetryBuilder,
noTracking: o.noTracking,
pollsToArchive: c.PollsToArchive,
Copy link
Member

Choose a reason for hiding this comment

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

This will always be 0 because in line 92 the field PollsToArchive is not mapped to a configuration setting. Is this intended?

PollsToArchive int `mapstructure:"-"` // TODO: activate this config once archiving is set up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andrzej-stencel I've added documentation and enabled the config in line 92. Can you take a look when you have a moment?

@VihasMakwana
Copy link
Contributor Author

Reviewing this PR was hard for me due to the complexity of the code. I'm worried that the code is getting even more complex with these changes. We should work on decreasing its complexity in future contributions.

I agree. I'll work on this part to reduce complexity of this specific piece of code.

@VihasMakwana
Copy link
Contributor Author

@andrzej-stencel @djaglowski we can break this PR into multiple ones, in following way:

  1. Separate out processUnmatchedFiles function in a smaller PR.
  2. Integrate it with makeReaders function and add documentation and enable config.
  3. Then, refactor as needed.

let me know what do you think.

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

I too am struggling to make sense of this level of complexity. Usually my response to this is to make smaller, more testable, packages which try to do less. Would it make sense to implement the archive as a small separate package?

The handling of edge cases is elaborate. Can we start without them? (i.e. just reboot the archive under these rare circumstances)

@@ -0,0 +1,172 @@
# File archiving
Copy link
Member

Choose a reason for hiding this comment

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

This document is full of typos and inconsistent formatting. Please take a pass through to clean it up.

@VihasMakwana
Copy link
Contributor Author

I too am struggling to make sense of this level of complexity. Usually my response to this is to make smaller, more testable, packages which try to do less. Would it make sense to implement the archive as a small separate package?

Thanks for you comment!
It should be possible to move it to a small package. I'll keep you posted.

@VihasMakwana
Copy link
Contributor Author

The handling of edge cases is elaborate. Can we start without them? (i.e. just reboot the archive under these rare circumstances)

@djaglowski
QQ: when you say this, you mean to reboot the archive if the pollsToArchive has changed, right? i.e. effectively removing the archive restoration for now and focus on integrating it to a new package first.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

Copy link
Contributor

github-actions bot commented May 9, 2025

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this May 9, 2025
@andrzej-stencel
Copy link
Member

Superseded by #39901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants