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

auto-commit new video thumbnails generated in bin/cron/fetch_external_resources #16313

Merged
merged 1 commit into from Jul 12, 2017

Conversation

davidsbailey
Copy link
Member

When videos are added to videos.csv, a cronjob on staging updates the database and the local filesystem to reflect the changes. An engineer must then scoop the images under dashboard/public/c/video_thumbnails/ or else videos and thumbnails will be mismatched. In the best case, a failure to do this leads to a failed DTT. In the worst case, if none of the mismatched thumbnails are covered by tests, a wrong video thumbnail could make it to production.

This PR modifies the cronjob to commit and push the new video thumbnails to origin/staging, minimizing the chances of a DTT which includes changes to videos.csv without the corresponding changes to dashboard/public/c/video_thumbnails/.

verification

initial conditions:

Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ git status
On branch auto-commit-video-thumbnails
Changes to be committed:
	modified:   bin/cron/fetch_external_resources

Untracked files:
	dashboard/public/c/video_thumbnails/218.jpg
Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ git difftool HEAD origin/auto-commit-video-thumbnails 
Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ 

cronjob run:

Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ bin/cron/fetch_external_resources 
[auto-commit-video-thumbnails d33ee3ea38] committing video thumbnails from bin/cron/fetch_external_resources in development
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 dashboard/public/c/video_thumbnails/218.jpg
Counting objects: 6, done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 564 bytes | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:code-dot-org/code-dot-org.git
   de193fd269..d33ee3ea38  auto-commit-video-thumbnails -> auto-commit-video-thumbnails

video thumbnails were committed and pushed:

Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ git log --stat -1
commit d33ee3ea38ce48682e7a378404f9c6c27f076140
Author: David Bailey <davidsbailey@users.noreply.github.com>
Date:   Fri Jul 7 17:32:18 2017 -0700

    committing video thumbnails from bin/cron/fetch_external_resources in development

 dashboard/public/c/video_thumbnails/218.jpg | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ git diff HEAD origin/auto-commit-video-thumbnails 
Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ 

non-video files in the git index were not committed:

Davids-MacBook-Pro-2:~/src/cdo (auto-commit-video-thumbnails)$ git status
On branch auto-commit-video-thumbnails
Changes to be committed:
	modified:   bin/cron/fetch_external_resources

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.

None yet

2 participants