Skip to content

Presidents Timeline in Committee Members Page - #490

Open
mu-tsu-mi wants to merge 14 commits into
rubyaustralia:mainfrom
mu-tsu-mi:presidents_table
Open

Presidents Timeline in Committee Members Page#490
mu-tsu-mi wants to merge 14 commits into
rubyaustralia:mainfrom
mu-tsu-mi:presidents_table

Conversation

@mu-tsu-mi

Copy link
Copy Markdown
Contributor

I added a timeline for Ruby Australia presidential history to the current committee members page based on the idea by @ZimbiX . Please refer below and review this request.

I used the existing yml files (committee.yml for the current president and previous.yml for all of previous presidents) to get president names, term start and term end. Presidents data is sourced from forum archive, Slack announcements and commits to those yml files. All logic for this timeline lives in the committee_helper file.

Screenshot 2026-07-18 at 4 38 32 pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a “Presidents Timeline” visualization to the Committee Members page, sourcing presidential term data from existing committee YAML data and computing timeline segments in CommitteeHelper.

Changes:

  • Extend committee data YAML to include president term start/end dates (including missing historical president entry data).
  • Render a timeline chart on committee-members page using helper-provided president/term calculations.
  • Add a helper spec to validate the presidents data pipeline.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
app/helpers/committee_helper.rb Adds logic to load, group, and compute timeline term segments for presidents.
app/views/pages/committee-members.html.erb Renders the presidents timeline UI above the committee members grid.
config/data/committee.yml Adds start/end dates for the current president’s term.
config/data/previous.yml Adds/updates historical president term ranges and appends a missing president entry.
spec/helpers/committee_helper_spec.rb Introduces initial tests for CommitteeHelper#presidents.

Comment thread app/helpers/committee_helper.rb
Comment thread app/helpers/committee_helper.rb
Comment thread app/helpers/committee_helper.rb
Comment on lines +44 to +51
def load_presidents
current_committee = YAML.load_file Rails.root.join('config/data/committee.yml')
previous_committee = YAML.load_file Rails.root.join('config/data/previous.yml')

(current_committee + previous_committee)
.filter { |member| president?(member) }
.map { |p| { name: p['name'], start: to_array(p['start']), end: to_array(p['end']) } }
end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure the consequence, but CommitteeHelper is included in ApplicationHelper already. I suppose I can keep this as is since priority by Copilot seems to be low. @simonhildebrandt , what do you think?

@simonhildebrandt simonhildebrandt Jul 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm agonising over this a bit, because while I generally think Copilot is right about removing the duplication, I'm a bit against the Rails magic of code in Helper files, because I'm suspicious of their ability to call each other. So on balance I think you're OK to keep them where they are, for the moment.

I think the fix for the future would be to load the YAML files once and cache them - they could be part of the Rails configuration, or stashed on the current thread - anything to save us loading them for every request (and in the case of def committee, every usage).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review on this too. I will leave this as is for now. The future fix idea sounds ideal 🙂

Comment thread app/views/pages/committee-members.html.erb Outdated
Comment thread config/data/previous.yml
Comment on lines +4 to +16
describe '#presidents' do
it 'returns a list of presidents' do
expect(helper.presidents).not_to be_empty
end

it 'has Keith as the oldest president' do
expect(helper.presidents[-1][:name]).to eq('Keith Pitty')
end

it 'is 2012/06/16 when the second oldest president term starts' do
expect(helper.presidents[-2][:start][0]).to eq('2012-06-16')
end
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One way to address this might be to mock the YAML loading part of this, so you can control the data - something like:

before do
  allow(YAML).to receive(:load_file).with(Rails.root.join('config/data/committee.yml')).and_return([{name: 'Nick Wolf', etc}])
end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @simonhildebrandt for your advice! I added mock and adjusted tests. I also bunched those tests into one.

Comment thread app/helpers/committee_helper.rb Outdated
@mu-tsu-mi

Copy link
Copy Markdown
Contributor Author

@simonhildebrandt , I have made adjustments according to your advice and copilot suggestions. Please see comments for each item and review those updates.

@@ -1,12 +1,17 @@
<% title "Previous Committee Members" %>
-<% title "Previous Committee Members" %>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Was this dash intentional? Or maybe a merge issue, or typo? (I just ask 'cause it looks slightly strange. 😅 )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for noticing this little strange dash. I removed it now.

@simonhildebrandt simonhildebrandt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The mocks look great, and so does the result. Well done!

(One small question on the committee members template, but I won't hold up the PR for that.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants