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

feat(pub): defaults debugKey to serviceid #1153

Merged
merged 2 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ module.exports = function strain() {
.option('debug-key', {
alias: 'debugKey',
describe: 'The key to enable the X-Debug header (default is the fastly service id)',
default: '',
type: 'string',
})
.conflicts('only', 'exclude')
Expand Down
6 changes: 2 additions & 4 deletions src/remotepublish.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,8 @@ ${e}`);
const token = this._fastly.writeDictItem(this._version, 'secrets', 'GITHUB_TOKEN', this._githubToken);
jobs.push(token);
}
if (this._debug_key) {
const debugKey = this._fastly.writeDictItem(this._version, 'secrets', 'DEBUG_KEY', this._debug_key);
jobs.push(debugKey);
}
const debugKey = this._fastly.writeDictItem(this._version, 'secrets', 'DEBUG_KEY', this._debug_key || this._fastly_namespace);
jobs.push(debugKey);
return Promise.all(jobs).then(() => {
this.tick(2, 'enabled authentication', true);
return true;
Expand Down
12 changes: 6 additions & 6 deletions test/testRemotePublishCmd.botconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('hlx publish --remote (default)', () => {
.withDryRun(false);
await remote.run();

sinon.assert.calledThrice(writeDictItem);
sinon.assert.callCount(writeDictItem, 4);
sinon.assert.calledOnce(purgeAll);

const log = await logger.getOutput();
Expand Down Expand Up @@ -189,7 +189,7 @@ describe('hlx publish --remote (default)', () => {
.withDryRun(false);
await remote.run();

sinon.assert.calledThrice(writeDictItem);
sinon.assert.callCount(writeDictItem, 4);
sinon.assert.calledOnce(purgeAll);

const log = await logger.getOutput();
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('hlx publish --remote (default)', () => {
.withDryRun(false);
await remote.run();

sinon.assert.calledThrice(writeDictItem);
sinon.assert.callCount(writeDictItem, 4);
sinon.assert.calledOnce(purgeAll);

const log = await logger.getOutput();
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('hlx publish --remote (default)', () => {
.withDryRun(false);
await remote.run();

sinon.assert.calledThrice(writeDictItem);
sinon.assert.callCount(writeDictItem, 4);
sinon.assert.calledOnce(purgeAll);

const log = await logger.getOutput();
Expand Down Expand Up @@ -380,7 +380,7 @@ describe('hlx publish --remote (default)', () => {
.withDryRun(false);
await remote.run();

sinon.assert.calledThrice(writeDictItem);
sinon.assert.callCount(writeDictItem, 4);
sinon.assert.calledOnce(purgeAll);

const log = await logger.getOutput();
Expand Down Expand Up @@ -455,7 +455,7 @@ describe('hlx publish --remote (default)', () => {
.withDryRun(false);
await remote.run();

sinon.assert.calledThrice(writeDictItem);
sinon.assert.callCount(writeDictItem, 4);
sinon.assert.calledOnce(purgeAll);

const log = await logger.getOutput();
Expand Down
2 changes: 1 addition & 1 deletion test/testRemotePublishCmd.dryrun.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('hlx publish --remote --dry-run (default)', () => {
.withDryRun(true);
await remote.run();

sinon.assert.calledTwice(writeDictItem);
sinon.assert.calledThrice(writeDictItem);
sinon.assert.notCalled(purgeAll);
});
});
2 changes: 1 addition & 1 deletion test/testRemotePublishCmd.failpurge.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('hlx publish --remote (fail purge)', () => {
if (e instanceof AssertionError) {
assert.fail(e);
}
sinon.assert.calledTwice(writeDictItem);
sinon.assert.calledThrice(writeDictItem);
}
});

Expand Down