Skip to content

refactor(app-canary): monitor only a single GUID #239

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

Merged
merged 10 commits into from
Jul 17, 2025

Conversation

cgraham-rs
Copy link
Contributor

@cgraham-rs cgraham-rs commented Jul 11, 2025

Refactor includes:

  • Only monitoring a single GUID
  • Removing pandas since we no longer need to store a dataset of multiple content results
  • Displaying monitoring results in a callout instead of a table since we are no longer collecting multiple content results
  • Displaying any errors in a callout instead of shoving them into the results (previously directly into the results table). This makes the error much more consumable and functions as providing feedback about malformed/invalid GUID, or GUID you don't have access to for whatever reason
  • Improved output when you don't have permissions to view the logs for the monitored content, which should only happen if you are a viewer
  • Significant refactoring of the overall code to reduce duplication and complexity

This is deployed on our internal Connect server: https://dogfood.team.pct.posit.it/connect/#/apps/54e4557b-812d-4f70-afc6-9f2e5022a179/environment

Fixes https://github.com/posit-dev/connect/issues/32394
Fixes https://github.com/posit-dev/connect/issues/32404

Tests

  • No CANARY_GUID env var set
    • If scheduled, DOES NOT send an email
  • Invalid GUID
    • If scheduled, sends an email
  • Valid GUID for content you are a owner of
  • Valid GUID for content you are a collaborator of
  • Valid GUID for content you are a viewer of
  • Valid GUID for content you do not have access to (not in ACL, etc.)
    • In the above setup, where the monitored content passing validation, if scheduled, DOES NOT send an email
  • Valid GUID, content is published but fails validation
    • If scheduled, sends an email

Required env var not set.
Screenshot 2025-07-11 at 1 11 56 PM

Invalid GUID set
Screenshot 2025-07-11 at 1 12 43 PM

image

Valid GUID, owner of content, content passes validation
Screenshot 2025-07-11 at 1 13 35 PM

Valid GUID, collaborator of content, content passes validation
image

Valid GUID, viewer of content, content passes validation
Screenshot 2025-07-11 at 1 28 12 PM

Vaid GUID, no permission to content
image

image

Valid GUID, owner of content, content fails validation
Screenshot 2025-07-11 at 1 22 34 PM

image

@cgraham-rs cgraham-rs changed the title feat(app-canary): monitor only a single GUID refactor(app-canary): monitor only a single GUID Jul 11, 2025
@cgraham-rs cgraham-rs marked this pull request as ready for review July 11, 2025 21:06
Copy link
Collaborator

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

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

This was a somewhat fast review. The code looks understandable. I published the bundle and pointed it at a broken application, and got the expected email. Looks good. And managing only a single variable is much easier.

show_instructions = True
instructions.append(f"CANARY_GUIDS environment variable is set but is empty or contains only whitespace. It should be a comma separated list of GUID you wish to monitor. Raw CANARY_GUIDS value: '{canary_guids_str}'")
instruction = f"Please set the <b>{var_name}</b> environment variable and re-render the report."
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the final version maybe we wanna tell them where to click to re-render? I mean, maybe they know, but maybe a screenshot of the button. ¯_(ツ)_/¯

Copy link
Contributor Author

@cgraham-rs cgraham-rs Jul 17, 2025

Choose a reason for hiding this comment

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

Do you have a strong feeling about this? I am assuming that if someone has published something to Connect they know how to re-render? I'm noting that the Posit Connect UI button tooltip is Refresh Report and I'm not quickly finding anything in the Posit Connect User Guide that seems to document that process. Regardless, there could be a language/wording mismatch here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will change this wording in a follow-on PR.

@cgraham-rs cgraham-rs merged commit 96cedb6 into main Jul 17, 2025
16 checks passed
@cgraham-rs cgraham-rs deleted the cgraham/app-canary-single-guid branch July 17, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants