Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Set file mod time in KopiaWrapper #1405

Merged
merged 6 commits into from
Dec 2, 2022

Conversation

ashmrtn
Copy link
Contributor

@ashmrtn ashmrtn commented Oct 31, 2022

Description

Set the mod time of uploaded files to either the mod time of the item (if it has one) or the current time (if it does not have one). Also add tests to check caching in kopia works properly.

Type of change

  • 🌻 Feature
  • 🐛 Bugfix
  • 🗺️ Documentation
  • 🤖 Test
  • 💻 CI/Deployment
  • 🐹 Trivial/Minor

Issue(s)

part of:

merge after:

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@ashmrtn ashmrtn added enhancement New feature or request blocked Upstream item prevents completion labels Oct 31, 2022
@ashmrtn ashmrtn self-assigned this Oct 31, 2022
@ashmrtn ashmrtn temporarily deployed to Testing October 31, 2022 20:28 Inactive
@ashmrtn ashmrtn temporarily deployed to Testing October 31, 2022 20:28 Inactive
@ashmrtn ashmrtn marked this pull request as draft October 31, 2022 20:28
@ashmrtn ashmrtn temporarily deployed to Testing October 31, 2022 20:29 Inactive
@ashmrtn ashmrtn temporarily deployed to Testing October 31, 2022 20:29 Inactive
Comment on lines +51 to +52
// StreamModTime is used to provide the modified time of the stream's data.
type StreamModTime interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: slightly more in keeping with go interface naming convention.

Suggested change
// StreamModTime is used to provide the modified time of the stream's data.
type StreamModTime interface {
// ModTimer is used to provide the modified time of the stream's data.
type ModTimer interface {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm actually now that I look at it more, can we hold off on this. I wanted to keep it consistent with some of the other interfaces defined in the file (StreamSize, StreamInfo). I think either we should change all of them in a different patch or leave them all consistency

@ashmrtn ashmrtn force-pushed the 621-kopia-streaming-file-mod-time branch from dff9f33 to 55df307 Compare November 2, 2022 23:53
@ashmrtn ashmrtn temporarily deployed to Testing November 2, 2022 23:53 Inactive
@ashmrtn ashmrtn temporarily deployed to Testing November 2, 2022 23:53 Inactive
@ashmrtn ashmrtn temporarily deployed to Testing November 2, 2022 23:54 Inactive
@ashmrtn ashmrtn temporarily deployed to Testing November 2, 2022 23:54 Inactive
@ashmrtn ashmrtn changed the base branch from main to 1404-kopia-use-prev-snapshots November 2, 2022 23:54
@ashmrtn ashmrtn marked this pull request as ready for review November 2, 2022 23:55
@ashmrtn ashmrtn force-pushed the 1404-kopia-use-prev-snapshots branch from c3d3fbc to b6be41f Compare December 1, 2022 20:23
Base automatically changed from 1404-kopia-use-prev-snapshots to main December 2, 2022 16:25
Mod times allow kopia to skip uploading files it's previously uploaded
(assuming they haven't changed), so providing this information to it is
useful.
Mostly useful for testing, but could be reported to the user as well.
* default mod time for exchange mock connector item to the current time
  (preserve current behavior as long as items are not re-used)
* expand backup test to test for caching
@ashmrtn ashmrtn force-pushed the 621-kopia-streaming-file-mod-time branch from 55df307 to 6979e84 Compare December 2, 2022 16:32
@ashmrtn ashmrtn temporarily deployed to Testing December 2, 2022 16:33 Inactive
@ashmrtn ashmrtn added mergequeue and removed blocked Upstream item prevents completion labels Dec 2, 2022
@aviator-app
Copy link
Contributor

aviator-app bot commented Dec 2, 2022

Aviator status

Aviator will automatically update this comment as the status of the PR changes.

This PR was merged using Aviator.

@aviator-app aviator-app bot temporarily deployed to Testing December 2, 2022 16:37 Inactive
@aviator-app aviator-app bot temporarily deployed to Testing December 2, 2022 16:37 Inactive
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aviator-app aviator-app bot temporarily deployed to Testing December 2, 2022 16:38 Inactive
@aviator-app aviator-app bot temporarily deployed to Testing December 2, 2022 16:38 Inactive
@aviator-app aviator-app bot temporarily deployed to Testing December 2, 2022 16:38 Inactive
@aviator-app aviator-app bot merged commit 6dcbc8f into main Dec 2, 2022
@aviator-app aviator-app bot deleted the 621-kopia-streaming-file-mod-time branch December 2, 2022 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request mergequeue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

modify corso's kopia wrapper code to set mod time on StreamingFiles
2 participants