-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Project parser to support commit timestamps #6517
Open
grahamplata
wants to merge
11
commits into
main
Choose a base branch
from
gplata/populate-ts-6454
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grahamplata
changed the title
Update Project parser to support commit time stamps
Update Project parser to support commit timestamps
Jan 28, 2025
begelundmuller
requested changes
Feb 3, 2025
runtime/drivers/admin/repo.go
Outdated
Comment on lines
38
to
42
if h.downloadURL != "" { | ||
// use downloadURL as a proxy for CommitTimestamp for one-time uploads | ||
// It will change when new data is uploaded | ||
return time.Now(), nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In this case (where there is no connected Git repository), it needs to return the time the current project files were uploaded. You'll need to propagate that timestamp along with
downloadURL
– if you trace the provenance ofdownloadURL
, you'll find you can access that timestamp asasset.CreatedOn
here:Line 50 in d4fa2a1
return &adminv1.GetRepoMetaResponse{ - Looking in the old
CommitHash
implementation below, it returnsh.downloadURL
as the hash in the same case. That is actually not safe, and it would be good if you could fix that in this PR as well now that we're at it. Tracing it back as described above, it would be better to return that field as the value ofasset.ID
(which only changes if there's a new upload and does not leak the ability to download the files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@begelundmuller that makes sense to me. Made some adjustments
Co-authored-by: Benjamin Egelund-Müller <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the project parser to support commit timestamps. Enabling the UI to display the last timestamp the source project files were updated.
Git-connected projects, will utilize the current commit's timestamp, while non-Git deploys that will be the timestamp when the project files being served were uploaded.