-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add 'Until' column to contributors index #303
Open
joshuay03
wants to merge
1
commit into
rails:main
Choose a base branch
from
joshuay03:add-until-column-to-contributors-index
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.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
db/migrate/20150326181907_add_first_contribution_at_to_contributors.rb
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
10 changes: 10 additions & 0 deletions
10
db/migrate/20240824030051_add_last_contribution_at_to_contributors.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class AddLastContributionAtToContributors < ActiveRecord::Migration[7.1] | ||
def up | ||
add_column :contributors, :last_contribution_at, :datetime | ||
Contributor.set_last_contribution_timestamps | ||
end | ||
|
||
def down | ||
remove_column :contributors, :last_contribution_at | ||
end | ||
end |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# WARNING: contributors.yml has first contribution timestamps that depend on | ||
# WARNING: contributors.yml has contribution timestamps that depend on | ||
# these fixtures. Keep them in sync as needed. | ||
# | ||
# In the following comments we assumed today is 26 December 2012. | ||
|
@@ -40,7 +40,7 @@ commit_26c024e: | |
one, because it is issued at parse-time. It seemed to in | ||
some places because the constant was the only expression in | ||
the block and therefore it was its return value, that could | ||
potentially be used by silence_warnings are return value of | ||
potentially be used by silence_warnings as a return value of | ||
the yield call. | ||
|
||
To bypass the warning we assign to a variable. The chosen | ||
|
@@ -90,6 +90,20 @@ commit_5b90635: | |
release: 'v3_2_0' | ||
merge: false | ||
|
||
# This commit belongs to this year, release 4.0.0 | ||
commit_e243a8a: | ||
sha1: 'e243a8a32eb4c8777f07ca4b974bd7e38d9477d3' | ||
author_email: '[email protected]' | ||
author_name: 'José Valim' | ||
author_date: '2012-07-18 07:21:57' | ||
committer_email: '[email protected]' | ||
committer_name: 'José Valim' | ||
committer_date: '2012-07-18 07:47:52' | ||
message: | | ||
Update changelog for migration generator change | ||
release: v4_0_0 | ||
merge: false | ||
|
||
# This commit is seven years old, release v0.14.4. | ||
commit_e0ef631: | ||
sha1: 'e0ef63105538f8d97faa095234f069913dd5229c' | ||
|
@@ -106,7 +120,7 @@ commit_e0ef631: | |
release: 'v0_14_4' | ||
merge: false | ||
|
||
# This commit has a committer_date that is more recent the author_date and | ||
# This commit has a committer_date that is more recent than the author_date and | ||
# should appear in the contributions list before 5b90635. | ||
commit_7cdfd91: | ||
sha1: '7cdfd910b7cdd398f8b54542c5a6a17966a5c8f3' | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,34 +4,53 @@ class RepoTest < ActiveSupport::TestCase | |||||
test '#sync_ranks' do | ||||||
Repo.new.send(:sync_ranks) | ||||||
|
||||||
{jeremy: 1, david: 2, jose: 3, xavier: 3, vijay: 3}.each do |c, r| | ||||||
{jeremy: 1, david: 2, jose: 2, xavier: 4, vijay: 4}.each do |c, r| | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a bug. Not introduced here cause it can be observed on the official site. I think it makes more sense that if multiple contributors share a rank the next contributor should be assigned the next rank i.e. this should be:
Suggested change
|
||||||
assert_equal r, contributors(c).rank | ||||||
end | ||||||
end | ||||||
|
||||||
test '#sync_first_contributed_timestamps' do | ||||||
Contributor.update_all(first_contribution_at: nil) | ||||||
Repo.new.send(:sync_first_contribution_timestamps) | ||||||
test '#sync_contribution_timestamps' do | ||||||
Contributor.update_all(first_contribution_at: nil, last_contribution_at: nil) | ||||||
Repo.new.send(:sync_contribution_timestamps) | ||||||
|
||||||
assert_first_contribution :commit_e0ef631, :david | ||||||
assert_last_contribution :commit_339e4e8, :david | ||||||
|
||||||
assert_first_contribution :commit_5b90635, :jeremy | ||||||
assert_last_contribution :commit_b821094, :jeremy | ||||||
|
||||||
assert_first_contribution :commit_5b90635, :jose | ||||||
assert_last_contribution :commit_e243a8a, :jose | ||||||
|
||||||
assert_first_contribution :commit_26c024e, :xavier | ||||||
assert_last_contribution :commit_26c024e, :xavier | ||||||
|
||||||
assert_first_contribution :commit_6c65676, :vijay | ||||||
assert_last_contribution :commit_6c65676, :vijay | ||||||
end | ||||||
|
||||||
test '#sync_first_contributed_timestamps rebuilding all' do | ||||||
test '#sync_contribution_timestamps rebuilding all' do | ||||||
Contributor.update_all( | ||||||
first_contribution_at: Commit.minimum(:committer_date) - 1.year | ||||||
first_contribution_at: Commit.minimum(:committer_date) - 1.year, | ||||||
last_contribution_at: Commit.maximum(:committer_date) + 1.year | ||||||
) | ||||||
|
||||||
Repo.new(rebuild_all: true).send(:sync_first_contribution_timestamps) | ||||||
Repo.new(rebuild_all: true).send(:sync_contribution_timestamps) | ||||||
|
||||||
assert_first_contribution :commit_e0ef631, :david | ||||||
assert_last_contribution :commit_339e4e8, :david | ||||||
|
||||||
assert_first_contribution :commit_5b90635, :jeremy | ||||||
assert_last_contribution :commit_b821094, :jeremy | ||||||
|
||||||
assert_first_contribution :commit_5b90635, :jose | ||||||
assert_last_contribution :commit_e243a8a, :jose | ||||||
|
||||||
assert_first_contribution :commit_26c024e, :xavier | ||||||
assert_last_contribution :commit_26c024e, :xavier | ||||||
|
||||||
assert_first_contribution :commit_6c65676, :vijay | ||||||
assert_last_contribution :commit_6c65676, :vijay | ||||||
end | ||||||
|
||||||
def assert_first_contribution(commit, contributor) | ||||||
|
@@ -40,4 +59,11 @@ def assert_first_contribution(commit, contributor) | |||||
|
||||||
assert_equal expected, actual | ||||||
end | ||||||
|
||||||
def assert_last_contribution(commit, contributor) | ||||||
expected = commits(commit).committer_date | ||||||
actual = contributors(contributor).last_contribution_at | ||||||
|
||||||
assert_equal expected, actual | ||||||
end | ||||||
end |
Oops, something went wrong.
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.
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.
Duplicated below.