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

Update default campaign automatically (#5082) #5633

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

gabina
Copy link
Member

@gabina gabina commented Feb 8, 2024

What this PR does

This PR schedules an automatic job that runs at the beginning of the spring and fall in northern hemisphere (please double-check these dates):

  • March, 21st
  • September, 21st

The job performs a default campaign update using DefaultCampaignUpdate class. First of all, it determines the current term (for example, 'spring_2024' or 'fall_2024'). If the current term already exists as a campaign (this is manually created each year according to the issue description), then the current term is set as the default campaign.
Otherwise, default campaign is not updated.

Notice that the update is only done when wiki_education feature is set to true, as I understand the scope of the issue is for Wiki Education Dashboard.

Closes #5082

Open questions and concerns

  • Double-check the spring and fall start dates.
  • Determine if there is any fallback that we want to use when the current term doesn't exist as a campaign.

@gabina gabina changed the title [WIP] Update default campaign automatically (#5082) Update default campaign automatically (#5082) Feb 8, 2024
@gabina
Copy link
Member Author

gabina commented Feb 8, 2024

Failing specs are not related to these changes.

@ragesoss
Copy link
Member

Code and tests look great! I'll give it a spin soon.

@@ -33,7 +33,7 @@
context 'when WikiEd Feature disabled' do
before { allow(Features).to receive(:wiki_ed?).and_return(false) }

it 'run default campaign update' do
it 'do not run default campaign update' do
Copy link
Member Author

Choose a reason for hiding this comment

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

I just fixed this, since the description was incorrectly saying "run default campaign update", when what I wanted to specified was the opposite.

@ragesoss
Copy link
Member

We don't actually want to switch these based on the current season, but rather based on the academic calendar where 'spring' is the semester that starts in January. I think the right dates for this feature are January 1 through June 30 for spring, and July 1 through December 31 for fall.

@ragesoss ragesoss marked this pull request as draft February 26, 2024 23:42
@gabina
Copy link
Member Author

gabina commented Feb 27, 2024

We don't actually want to switch these based on the current season, but rather based on the academic calendar where 'spring' is the semester that starts in January. I think the right dates for this feature are January 1 through June 30 for spring, and July 1 through December 31 for fall.

oh that makes sense! I changed the dates on commit 927f807, and added some comments to clarify that dates are related to spring/fall semesters based on academic calendar.

@gabina gabina marked this pull request as ready for review April 8, 2024 20:52
@gabina gabina closed this May 14, 2024
@gabina gabina deleted the update-deafult-campaign-automatically branch May 14, 2024 19:18
@gabina gabina restored the update-deafult-campaign-automatically branch May 17, 2024 19:37
@gabina
Copy link
Member Author

gabina commented May 17, 2024

I closed this PR by mistake and I don't think I'm able to reopen it now. But it should be re-opened, as it's ready for review and merge.

@ragesoss ragesoss reopened this May 17, 2024
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.

Default campaign should be determined automatically
2 participants