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(wiby result): change result command output and exit codes #74

Merged
merged 5 commits into from
Jan 27, 2021

Conversation

rodion-arr
Copy link
Member

@rodion-arr rodion-arr commented Jan 9, 2021

Following #57 (comment) this PR introduces updates to wiby result command:

  • Logs
    • debug package added as dependency
    • simple wrapper module for debug added
    • all console logs replaced with wrapper logger
    • logs for wiby test command enabled programmatically in order to save old outputs
    • each command got own log namespace (wiby:test, wiby:result, etc)
    • all logs can be enabled with DEBUG=wiby:* env
  • wiby result
    • default export does not print intermediate logs now by default. Old logs can be enabled with DEBUG env
    • default export returns result object instead
    • based on returned object - relevant markdown is building (example)
    • failed checks will exit with code 1
    • pending checks will exit with code 64
    • result tests updated to check relevant output and exit code
    • default export returns object of next format:
{
   "status":"failure",
   "results":[
      {
         "dependent":"wiby-test/partial",
         "status":"pending",
         "runs":[
            ["Travis CI - Branch", null]
         ]
      },
      {
         "dependent":"wiby-test/fail",
         "status":"failure",
         "runs":[
            [ "Travis CI - Branch", "failure" ]
         ]
      },
      {
         "dependent":"wiby-test/pass",
         "status":"pending",
         "runs":[
             [ "Travis CI - Branch", null ]
         ]
      }
   ]
}

Related to #57

lib/logger.js Show resolved Hide resolved

statuses.push(status)
})

Copy link
Contributor

Choose a reason for hiding this comment

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

If I am reading this correctly once we have completed iterating over all the runs and the isAllSuccess is still true.

Then following the methodology below should we return pipelineStatses.SUCCEED and change the final return to pipelineStatses.FAILED ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed this will simplify code a bit, submitted changes

@ghinks
Copy link
Contributor

ghinks commented Jan 14, 2021

I saw the changes you made in the getOverallStatusForAllRuns, many thanks.

Still reviewing. I took the main branch and merged back into your changes and created scoped package @gvhinks/[email protected]. I then created a PR on a dependency test package. The PR's associated action completed once I typed wiby result.

I took some screen shots of the actions with DEBUG=wiby:*

Screen Shot 2021-01-14 at 5 50 32 PM

Screen Shot 2021-01-14 at 5 51 54 PM

from an integration point of view its looking good.

lib/result.js Outdated Show resolved Hide resolved
@dominykas
Copy link
Member

Looks good, aside from what I assume was a typo?

@dominykas dominykas merged commit 4e27db5 into pkgjs:master Jan 27, 2021
@dominykas
Copy link
Member

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rodion-arr rodion-arr deleted the pretty_print_result branch March 25, 2021 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants