Skip to content

GraphQL Cron Job #182

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

Merged
merged 4 commits into from
Jul 29, 2022
Merged

GraphQL Cron Job #182

merged 4 commits into from
Jul 29, 2022

Conversation

leo-step
Copy link
Contributor

Implementing automatic question metadata updates using GitHub workflows and LeetCode's GraphQL API

@leo-step
Copy link
Contributor Author

leo-step commented Jul 29, 2022

Completed first step as outlined in issue #179

  1. Introduce a GitHub Workflow (without any cron job for now) to automatically run the Python script you had authored in update difficulties for questions #177 and print the output to the console - this should introduce us to GitHub Workflows with hopefully a straight-forward template

Using act for local testing.

@leo-step leo-step marked this pull request as draft July 29, 2022 15:28
Copy link
Owner

@seanprashad seanprashad left a comment

Choose a reason for hiding this comment

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

This is looking like a great start! We can definitely land it now - we might need to refactor how we import our question list since it looks like questions.py is a Python file and not JSON. I don't think this is a huge problem, but something to be aware of when we fully integrate things!

Edit: What were the commands you were using to verify the syntax/logic using act? I'm trying to replicate it on my end, however my console isn't printing anything out running:

 sprashad@home  ~/projects/leetcode-patterns   graphql-cron-job  act -v
DEBU[0000] Loading environment from /Users/sprashad/projects/leetcode-patterns/.env
DEBU[0000] Loading secrets from /Users/sprashad/projects/leetcode-patterns/.secrets
DEBU[0000] Loading workflows from '/Users/sprashad/projects/leetcode-patterns/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'run-python.yml' in '/Users/sprashad/projects/leetcode-patterns/.github/workflows/run-python.yml'
DEBU[0000] Reading workflow '/Users/sprashad/projects/leetcode-patterns/.github/workflows/run-python.yml'
DEBU[0000] Planning event: push

@leo-step leo-step marked this pull request as ready for review July 29, 2022 17:15
@leo-step
Copy link
Contributor Author

leo-step commented Jul 29, 2022

This is looking like a great start! We can definitely land it now - we might need to refactor how we import our question list since it looks like questions.py is a Python file and not JSON. I don't think this is a huge problem, but something to be aware of when we fully integrate things!

Edit: What were the commands you were using to verify the syntax/logic using act? I'm trying to replicate it on my end, however my console isn't printing anything out running:

 sprashad@home  ~/projects/leetcode-patterns   graphql-cron-job  act -v
DEBU[0000] Loading environment from /Users/sprashad/projects/leetcode-patterns/.env
DEBU[0000] Loading secrets from /Users/sprashad/projects/leetcode-patterns/.secrets
DEBU[0000] Loading workflows from '/Users/sprashad/projects/leetcode-patterns/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'run-python.yml' in '/Users/sprashad/projects/leetcode-patterns/.github/workflows/run-python.yml'
DEBU[0000] Reading workflow '/Users/sprashad/projects/leetcode-patterns/.github/workflows/run-python.yml'
DEBU[0000] Planning event: push

I was running act workflow_dispatch --container-architecture linux/amd64 (you might not need the flag, I was using it because I'm on an M1 Mac).

Also, yes, I should change the questions to be in json format, but I just implemented everything as I had it originally for now.

@seanprashad seanprashad merged commit 6593519 into seanprashad:master Jul 29, 2022
@seanprashad
Copy link
Owner

This is looking like a great start! We can definitely land it now - we might need to refactor how we import our question list since it looks like questions.py is a Python file and not JSON. I don't think this is a huge problem, but something to be aware of when we fully integrate things!
Edit: What were the commands you were using to verify the syntax/logic using act? I'm trying to replicate it on my end, however my console isn't printing anything out running:

 sprashad@home  ~/projects/leetcode-patterns   graphql-cron-job  act -v
DEBU[0000] Loading environment from /Users/sprashad/projects/leetcode-patterns/.env
DEBU[0000] Loading secrets from /Users/sprashad/projects/leetcode-patterns/.secrets
DEBU[0000] Loading workflows from '/Users/sprashad/projects/leetcode-patterns/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'run-python.yml' in '/Users/sprashad/projects/leetcode-patterns/.github/workflows/run-python.yml'
DEBU[0000] Reading workflow '/Users/sprashad/projects/leetcode-patterns/.github/workflows/run-python.yml'
DEBU[0000] Planning event: push

I was running act workflow_dispatch --container-architecture linux/amd64 (you might not need the flag, I was using it because I'm on an M1 Mac).

Also, yes, I should change the questions to be in json format, but I just implemented everything as I had it originally for now.

Sounds good! Thank you!

@seanprashad
Copy link
Owner

https://github.com/seanprashad/leetcode-patterns/runs/7588724196?check_suite_focus=true

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