-
Notifications
You must be signed in to change notification settings - Fork 33
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
Simplify cron for checking to see if its the conda-forge wednesday #101
base: main
Are you sure you want to change the base?
Conversation
if wednesday.date() == today.date(): | ||
print("Match! Job should run.") | ||
import datetime, sys | ||
year, week, weekday = dt.isocalendar() |
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.
year, week, weekday = dt.isocalendar() | |
year, week, weekday = datetime.today().isocalendar() |
You mean this, right?
if week % 2 == 0: | ||
# conda forge meeting on even weeks | ||
print("conda-forge meeting match! Job should run.") | ||
with open(os.environ['GITHUB_ENV'], 'a') as f: | ||
print("should_run=yes", f) | ||
elif wednesday > today: | ||
print("Didn't match. Aborting.") | ||
break | ||
else: | ||
# conda community meeting on odd weeks | ||
print('conda community meeting!') |
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.
Nice, I checked and we do:
- conda-forge on even weeks
- conda-incubator on odd weeks
So for this repo we need to reverse the logic, but for conda-forge we need to migrate it. The problem is that we have been creating the meeting notes with some days in advance now (sometimes as soon as the meeting was over), so we need to do the check not for "today" but for the next even Wednesday.
So all in all I feel that this daily logic is not serving the community needs anymore. We probably need something like:
# runs every Thursday
if week_is_even:
date = next_even_wednesday()
export_date_to_env()
else:
exit 0 # do not run and wait for next week
cc @jaimergp I think this is a bit simpler and should work? could use a careful review though