-
Notifications
You must be signed in to change notification settings - Fork 85
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
Decouple telemetry API call from main action #24
Conversation
b688bb5
to
1058509
Compare
It gets cast to a string! Eep!
1058509
to
a598b2a
Compare
main() | ||
} else { | ||
// If emit_telemetry is not set, that indicates an older version of the dynamic workflow that doesn't separate telemetry from deployment | ||
main().then(() => require('./pre')) |
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.
This is to accomodate the time between tagging this release as v1
and switching over to the new version of the dynamic workflow. We should expect to remove this last condition after both this action and the dynamic workflow on dotcom are deployed and in use.
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.
Just a note that when we revise this in that future PR, we should also either:
- set the default value of the
emit_telemetry
input to"false"
, and/or - reduce this section of the code to just use
else { ...
rather thanelse if (emitTelemetry === "false")
.
79abd3d
to
32b8b86
Compare
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.
Only minor nits, no blockers here. 👍🏻
Curious question, though: in the future, do you think it would make sense to separate the ./pre
script into its own separate Action to avoid any potential confusion? 🤷🏻♂️
main() | ||
} else { | ||
// If emit_telemetry is not set, that indicates an older version of the dynamic workflow that doesn't separate telemetry from deployment | ||
main().then(() => require('./pre')) |
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.
Just a note that when we revise this in that future PR, we should also either:
- set the default value of the
emit_telemetry
input to"false"
, and/or - reduce this section of the code to just use
else { ...
rather thanelse if (emitTelemetry === "false")
.
This has been an established pattern with Actions for a long time; we don't have to worry about it changing. Co-authored-by: James M. Greene <[email protected]>
Co-authored-by: James M. Greene <[email protected]>
addresses https://github.com/github/pages-engineering/issues/1044
Changes deploy-pages to not automatically emit telemetry from the
src/pre.js
file, both as a "pre" action and as a chained promise after the deploy completes. Instead, telemetry (from the same file) is only run when a new inputemit_telemetry
is truthy.The matching PR to dotcom https://github.com/github/github/pull/213548 updates the dynamic workflow for jekyll page builds so that after the build, this action is invoked twice in parallel: once with
emit_telemetry: true
to make the telemetry API call, and once without to perform the deploy as usual (without any telemetry).People who use a "bring-your-own-workflow" to pages builds should not notice or care about this new input.
I expect to publish this version of the action to v1 before we deploy any code to dotcom that changes the dynamic workflow, so this action is designed to work for both current and newer versions of the dynamic workflow. When the
emit_telemetry
input is completely missing, this action falls back to its current behavior; when the input istrue
orfalse
, it adopts the new behavior that we want. Once the dotcom changes are deployed and we are confident in them, we can remove the fallback logic.