ember-cli-deploy / ember-cli-deploy-revision-data

An ember-cli-plugin to create a unique revision key for the build
MIT License
21 stars 58 forks source link

Add git-tag-commit and version-commit key generators #13

Closed alisdair closed 9 years ago

alisdair commented 9 years ago

Adding a couple of key generators so that I can deprecate my pre-0.5.0 plugin.

Git Tag Commit constructs a revision key from the git tag and commit hash. Version Commit is similar, but uses the package.json version instead of the tag. Both use git-repo-info to retrieve the git info.

Note that the tests for the Git Commit key generator depend on this git repository having a most recent tag matching the (fairly arbitrary) regex /^v?\d+\.\d+\.\d+.*\+[0-9a-f]{8}$/.

I tried to add a fake git repository in the fixtures, but git refused to add the files. I couldn't think of any other way to test this code without introducing dependency injection of the git-repo-info function into the plugin config.

Tests relating to git use some real git repositories as fixtures, with the .git directory renamed to dotgit so that we can add them to this repo, and some extraneous files removed to minimise the diff.

I also haven't had a chance to try this for real yet, I don't have a v0.5.0 ember-cli-deploy branch on any of my projects. Submitting for feedback & guidance.

Thanks for all your work on ember-cli-deploy!

alisdair commented 9 years ago

Build failed on CircleCI because it couldn't find the git tag. I've got some ideas about how to make the tests' interactions with git a bit more robust. Will push another commit tomorrow.

lukemelia commented 9 years ago

Nice work! Thank you. Creative solution to the testing challenge! I left a few comments. @achambers may have others.

alisdair commented 9 years ago

Thanks for the feedback! Pushed up a commit with fixes for your comments.

alisdair commented 9 years ago

@achambers Anything else I can do on this PR? If you want me to squash the commits please let me know.

achambers commented 9 years ago

Hi @alisdair. Thanks for this. If you could squash the commits that'd be great. I'll merge when that's done.

alisdair commented 9 years ago

Done, thanks!

achambers commented 9 years ago

Thanks mate