Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

bug 1395745: add endpoint for serving revision hash #303

Merged
merged 1 commit into from
Sep 6, 2017
Merged

bug 1395745: add endpoint for serving revision hash #303

merged 1 commit into from
Sep 6, 2017

Conversation

escattone
Copy link
Contributor

This PR adds the /revision endpoint and associated test. It depends on mdn/kuma#4399. The endpoint returns the value of the environment variable REVISION_HASH, the git commit hash of HEAD baked into the kumascript Docker image at the time of the build.

@escattone
Copy link
Contributor Author

The Travis build will fail until mdn/kuma#4399 is merged.

Copy link
Contributor

@jwhitlock jwhitlock left a comment

Choose a reason for hiding this comment

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

This appears to work with the undefined value. I'd like to wait for PR 4399 and passing tests to merge.

it('Revision endpoint returns git commit hash', function (done) {
testRequest(getURL('/revision'), done, function (resp, result) {
assert.equal(resp.statusCode, 200);
assert.equal(result, process.env.REVISION_HASH);
Copy link
Contributor

Choose a reason for hiding this comment

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

I get the string "undefined" back from the server, and the JS constant (?) undefined for process.env.REVISION_HASH. If you force to a string, the test passes:

assert.equal(result, '' + process.env.REVISION_HASH);

Or, we could wait for PR 4399, and make sure it passes.

@escattone escattone merged commit 41d0c3e into mdn:master Sep 6, 2017
jwhitlock added a commit to mdn/kuma that referenced this pull request Sep 7, 2017
* mdn/kumascript#296 - SpecName, spec2: Add Paint Timing
* mdn/kumascript#297 - SpecName: User Timing Level 2 display name
* mdn/kumascript#298 - InterfaceData.json: Add Performance interfaces
* mdn/kumascript#302 - SpecName, spec2: Add MediaStreamTrackHint
* mdn/kumascript#303 - Endpoint for serving the revision hash
* mdn/kumascript#305 - Compat: Dont check __compat for features w/o it
jwhitlock added a commit to mdn/kuma that referenced this pull request Sep 11, 2017
* mdn/kumascript#303 - EmbedInteractiveExamples: Set IE server from env
@escattone escattone deleted the add-endpoint-for-revision-hash-1395745 branch October 31, 2017 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants