Skip to content
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

expose "commit_time" #42

Open
yarikoptic opened this issue Apr 29, 2021 · 8 comments
Open

expose "commit_time" #42

yarikoptic opened this issue Apr 29, 2021 · 8 comments

Comments

@yarikoptic
Copy link
Member

Continuation to #40:
so there is a "commit timestamp" -- could you expose it as well please in UTC time zone (so if commits come from different contributors within the PR we still could sort them), probably in ISO8601 i.e. YYYY-MM-DDThh:mm:ssZ ?

@yarikoptic
Copy link
Member Author

then I would use {commit_time}-{abbrev_commit}/ and that would allow to get the likely sorting to get the "latest" of the commits in a PR

@jwodder
Copy link
Member

jwodder commented Apr 29, 2021

@yarikoptic Problem: When Travis builds a tag, it reports the committed_at field as null.

@yarikoptic
Copy link
Member Author

and it doesn't have a separate run and/or record on the corresponding commit itself?

@jwodder
Copy link
Member

jwodder commented Apr 29, 2021

@yarikoptic There is a separate build for the pushing of the tagged commit, but the only thing linking them is that they have the same commit ID. There's also no guarantee that there would be build for the commit, as a developer could push the tagged commit in the middle of several other commits.

@yarikoptic
Copy link
Member Author

ok, let's think about it

@yarikoptic
Copy link
Member Author

as a workaround I think I could just use time of the build and have eg. {hour}{minute}{second}-{commit_abbrev} so I would get a logical likely sorting for within a PR. Suboptimal (will differ between CIs etc) but provides a way forward.

an idea (rejected by the end): A possible implementation for commit_time could be: clone and cache locally (and regit fetch upon rerun) that repo with all the PRs heads : I have

[alias]
    add-fetch-pulls = !git config --add remote.origin.fetch '+refs/pull/*:refs/pull/origin/*' && git fetch origin

then we could have access to any information needed about a commit AFAIK as long as that commit is still available though -- might have been purged / rewritten etc, so wouldn't be robust for fetching older logs

@yarikoptic
Copy link
Member Author

as a workaround I think I could just use time of the build and have eg. {hour}{minute}{second}-{commit_abbrev} so I would get a logical likely sorting for within a PR. Suboptimal (will differ between CIs etc) but provides a way forward.

or will those times differ across jobs/workflows within the same commit+ci build @jwodder ?

@jwodder
Copy link
Member

jwodder commented May 24, 2021

@yarikoptic The timestamp is taken from the workflow run (GitHub) or build (Travis/Appveyor). If multiple runs/builds are triggered for the same commit, they may have different timestamps. However, for Travis & Appveyor, all jobs belonging to a given build will share the same timestamp.

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

No branches or pull requests

2 participants