Skip to content

Commit

Permalink
missed passing some logger functions appropriate object signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jbolda committed Jul 13, 2024
1 parent db348e8 commit 3c3522f
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 126 deletions.
6 changes: 6 additions & 0 deletions .changes/logger-poorly-formatted-objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"covector": patch:bug
"action": patch:bug
---

Missed some logger function which were improperly passed an non-message object. If rendering an object, it requires `msg` and `renderAsYAML`.
9 changes: 5 additions & 4 deletions packages/covector/src/arbitrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ export function* arbitrary({
});

if (dryRun) {
logger.info("==== commands ready to run ===");
logger.info(commands);
logger.info({
msg: "==== commands ready to run ===",
renderAsYAML: commands,
});
}

if (commands.length === 0) {
Expand Down Expand Up @@ -143,8 +145,7 @@ export function* arbitrary({
});

if (dryRun) {
logger.info("==== result ===");
logger.info(pkgCommandsRan);
logger.info({ msg: "==== result ===", renderAsYAML: pkgCommandsRan });
}

return <CovectorPublish>{ commandsRan: pkgCommandsRan, pipeTemplate };
Expand Down
9 changes: 5 additions & 4 deletions packages/covector/src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ export function* publish({
});

if (dryRun) {
logger.info("==== commands ready to run ===");
logger.info(commands);
logger.info({
msg: "==== commands ready to run ===",
renderAsYAML: commands,
});
}

if (commands.length === 0) {
Expand Down Expand Up @@ -143,8 +145,7 @@ export function* publish({
});

if (dryRun) {
logger.info("==== result ===");
logger.info(pkgCommandsRan);
logger.info({ msg: "==== result ===", renderAsYAML: pkgCommandsRan });
}

return <CovectorPublish>{ commandsRan: pkgCommandsRan, pipeTemplate };
Expand Down
8 changes: 4 additions & 4 deletions packages/covector/src/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ export function* status({
} else if (!!pre && assembledChanges?.changes?.length === 0) {
if (logs) {
logger.info("There are no changes.");
logger.info(
"We have previously released the changes in these files:",
changesPaths
);
logger.info({
msg: "We have previously released the changes in these files:",
renderAsYAML: changesPaths,
});
}
return { pkgReadyToPublish: [], response: "No changes." };
} else {
Expand Down
9 changes: 5 additions & 4 deletions packages/covector/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ export function* version({
cwd,
});
if (dryRun) {
logger.info("==== commands ready to run ===");
logger.info(commands);
logger.info({
msg: "==== commands ready to run ===",
renderAsYAML: commands,
});
}

let pkgCommandsRan: CommandsRan = Object.keys(config.packages).reduce(
Expand Down Expand Up @@ -186,8 +188,7 @@ export function* version({
}

if (dryRun) {
logger.info("==== result ===");
logger.info(pkgCommandsRan);
logger.info({ msg: "==== result ===", renderAsYAML: pkgCommandsRan });
}

return <CovectorVersion>{ commandsRan: pkgCommandsRan, pipeTemplate };
Expand Down
60 changes: 14 additions & 46 deletions packages/covector/test/integration/complex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,13 @@ describe("integration test for complex commands", () => {
command: "version",
msg: "==== commands ready to run ===",
level: 30,
},
{
command: "version",
// command data piped
level: 30,
renderAsYAML: {},
},
{
command: "version",
msg: "==== result ===",
level: 30,
},
{
command: "version",
// command data piped
level: 30,
renderAsYAML: {},
},
{
msg: "completed",
Expand Down Expand Up @@ -361,21 +353,19 @@ describe("integration test for complex commands", () => {
command: "publish",
msg: "==== data piped into commands ===",
level: 30,
renderAsYAML: {},
},
{
command: "publish",
msg: "==== data piped into commands ===",
level: 30,
renderAsYAML: {},
},
{
command: "publish",
msg: "==== commands ready to run ===",
level: 30,
},
{
command: "publish",
// TODO this has extra, check render YAML
level: 30,
renderAsYAML: {},
},
{
command: "publish",
Expand All @@ -391,12 +381,7 @@ describe("integration test for complex commands", () => {
command: "publish",
msg: "==== result ===",
level: 30,
},
{
command: "publish",
// TODO check YAML render
// msg: "boop",
level: 30,
renderAsYAML: {},
},
{
msg: "completed",
Expand Down Expand Up @@ -426,25 +411,20 @@ describe("integration test for complex commands", () => {
{
command: "arbitrary",
msg: "==== data piped into commands ===",
// TODO check YAML render
level: 30,
renderAsYAML: {},
},
{
command: "arbitrary",
msg: "==== data piped into commands ===",
// TODO check YAML render
level: 30,
renderAsYAML: {},
},
{
command: "arbitrary",
msg: "==== commands ready to run ===",
// TODO check YAML render
level: 30,
},
{
command: "arbitrary",
// TODO check command output
level: 30,
renderAsYAML: {},
},
{
command: "arbitrary",
Expand Down Expand Up @@ -490,11 +470,7 @@ describe("integration test for complex commands", () => {
command: "arbitrary",
msg: "==== result ===",
level: 30,
},
{
command: "arbitrary",
// TODO check result output
level: 30,
renderAsYAML: {},
},
{
msg: "completed",
Expand Down Expand Up @@ -525,22 +501,19 @@ describe("integration test for complex commands", () => {
command: "arbitrary",
msg: "==== data piped into commands ===",
level: 30,
renderAsYAML: {},
},
{
command: "arbitrary",
msg: "==== data piped into commands ===",
level: 30,
renderAsYAML: {},
},
{
command: "arbitrary",
msg: "==== commands ready to run ===",
level: 30,
},
{
command: "arbitrary",
// msg: "boop",
// data pipe
level: 30,
renderAsYAML: {},
},
{
command: "arbitrary",
Expand All @@ -556,12 +529,7 @@ describe("integration test for complex commands", () => {
command: "arbitrary",
msg: "==== result ===",
level: 30,
},
{
command: "arbitrary",
// msg: "boop",
// result
level: 30,
renderAsYAML: {},
},
{
msg: "completed",
Expand Down
Loading

0 comments on commit 3c3522f

Please sign in to comment.