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

Prettify provenance output #72

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Prettify provenance output #72

merged 1 commit into from
Sep 14, 2023

Conversation

lkwdwrd
Copy link
Contributor

@lkwdwrd lkwdwrd commented Sep 8, 2023

What code changed, and why?

Provenance data had a bug when initially putting pretty output together, but with that fixed the data can now be processed and output in a more human-readable format.

Definition of done

When requesting previews with provenance data, the output is formatted for human consumption rather than dumped JSON.

How to test

You can install this version from source code

Install from source

  1. Switch to current branch.
  2. Run npm install.
  3. Open project in VSCode.
  4. In the debugger be sure you have "Run Extension" mode selected.
  5. Invoke "run" (F5).

Exercise the Code

Set up an EOPA environment with preview enabled that uses bundles. Run a preview request to that environment ensuring the 'provenance' argument is set to true. Check the output to see the human-readable output.

Screenshot 2023-09-08 at 12 13 59 PM

}

if (r.printed) {
output += `PRINTED\n=======\n${r.printed}\n\n`;
output += `PRINTED\n=======\n${r.printed}\n`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR Bonus: There was an extra line added after printed lines because each ends with a new-line character. This cause three new lines instead of 2.

@@ -10,6 +10,7 @@
"typescript.tsc.autoDetect": "off",
"cSpell.words": [
"eopa",
"norc",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Author Note: ensure VS Code cspell does not complain about the name of the table style used.

Copy link
Member

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@@ -2,7 +2,7 @@
[![slack](https://img.shields.io/badge/slack-styra-24b6e0.svg?logo=slack)](https://styracommunity.slack.com/)
[![Apache License](https://img.shields.io/badge/license-Apache%202.0-orange.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/Styra.vscode-styra?color=24b6e0)](#)
[![Coverage](https://img.shields.io/badge/Coverage-74%25-brightgreen)](#)
Copy link
Member

Choose a reason for hiding this comment

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

Guessing this happened automatically. Interesting setup.

@lkwdwrd lkwdwrd merged commit 4b15333 into main Sep 14, 2023
4 checks passed
@lkwdwrd lkwdwrd deleted the luke/preview-pretty-output branch September 14, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants