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

pkg/vcs: use committer date than author date #2136

Merged
merged 1 commit into from
Oct 10, 2020

Conversation

KumanekoSakura
Copy link

The Freshness columns in Instances: table on the dashboard page look outdated, for
these fields are showing when that patch was authored. Showing when that patch was
committed into the tree in question would be more meaningful.

@codecov
Copy link

codecov bot commented Sep 25, 2020

Codecov Report

Merging #2136 into master will increase coverage by 0.0%.
The diff coverage is 44.4%.

Impacted Files Coverage Δ
pkg/vcs/vcs.go 43.5% <ø> (ø)
syz-ci/manager.go 0.5% <0.0%> (ø)
syz-ci/updater.go 0.0% <0.0%> (ø)
pkg/vcs/git.go 62.4% <57.1%> (-0.2%) ⬇️
pkg/host/machine_info.go 55.6% <0.0%> (+55.6%) ⬆️

@dvyukov
Copy link
Collaborator

dvyukov commented Sep 26, 2020

The date is used in multiple places, not just the Freshness column. It's also used to show commits (in the "git show" style), which needs to use the author date. Longer term we need both dates. So this change needs to obtain both, add CommitDate to the Commit struct, propagate to the dashboard, etc.
Please add Update #1537 to the commit description, that's the issue for this problem.

@KumanekoSakura KumanekoSakura force-pushed the my-branch3 branch 3 times, most recently from 3f5aef4 to 0717723 Compare October 8, 2020 07:23
@dvyukov
Copy link
Collaborator

dvyukov commented Oct 9, 2020

Nice!

By grepping for SyzkallerCommitDate and KernelCommitDate I found few other places that need to be updated as well.

		SyzkallerCommitDate: prog.GitRevisionDate,
./syz-ci/manager.go

This comes from GITREVDATE in Makefile. I think we can just change it to %cd as it's not used for anything else.

			resp.Build.KernelCommitDate = res.Commit.Date
	resp.Build.KernelCommitDate = kernelCommit.Date
./syz-ci/jobs.go

In both of these case we can now use CommitDate. Otherwise Build.KernelCommitDate will have different values for different builds in the database and it will be hard to make sense of these dates.

The Freshness columns in Instances: table on the dashboard page look outdated, for
these fields are showing when that patch was authored. Where possible, using when
that patch was committed into the tree in question would be more meaningful.

Update google#1537
@KumanekoSakura
Copy link
Author

Thank you for the comment. I assumed that

--format=%H%n%s%n%ae%n%an%n%ad%n%P%n%cd%n%b

makes

bytes.Split(output, []byte{'\n'})

in gitParseCommit() to return at least 8 elements (and therefore len(lines) < 8 is the right threshold to test). Am I correct?

@dvyukov
Copy link
Collaborator

dvyukov commented Oct 9, 2020

in gitParseCommit() to return at least 8 elements (and therefore len(lines) < 8 is the right threshold to test). Am I correct?

Yes, I think so.

I see both callers are covered by tests, so we should be good if tests pass.

syzkaller$ go test -coverprofile=coverprofile ./pkg/vcs
ok  	github.com/google/syzkaller/pkg/vcs	1.995s	coverage: 66.3% of statements
syzkaller$ go tool cover -html coverprofile

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.

2 participants