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

Send report to a github page report #373

Closed
courentin opened this issue Nov 1, 2022 · 6 comments
Closed

Send report to a github page report #373

courentin opened this issue Nov 1, 2022 · 6 comments
Labels
Documentation Improvements or additions to documentation Good First Issue 🥇 Good for newcomers Open to contribution 🧡

Comments

@courentin
Copy link

Is your feature request related to a problem? Please describe.

Sending reports through S3 is great but by default the s3 website will be publicly accessible. They are way to make it private but they seems pretty complex for a single page website.

Describe the solution you'd like

We could host the report on a github page repository, that would ease access control.
The idea would be to push the html file to a github repository.

@elongl
Copy link
Member

elongl commented Nov 1, 2022

Hi @courentin! Thanks for the great suggestion.
I'd like to share a couple of things if that's okay.

First off, you can also send your report to Slack or to a GCS bucket if those fit you better.
Regarding the S3, I agree that setting up a website could be tedious,
however, you can also upload the report to the bucket with a fixed name like report.html and grant access to that file.

Regarding your request, it seems like it should already be possible to do that.
Basically what you'd need to do is create a GitHub workflow in your GitHub Pages repository that does the following steps:

  1. Run Elementary's action.
  2. Run the add-and-commit action to commit the report to the repository.

Afterwards, you should see the report being updated in your website.

Here's an untested mock of how the workflow should work.

name: Run Elementary report
on:
  # Run the action when a push to the main branch of the repository is made.
  push:
    branches: [ "main", "master" ]

  # Run the action when a pull request to the main branch is opened.
  pull_request:
    branches: [ "main", "master" ]

  # Run the action in a scheduled manner every hour.
  schedule:
    - cron: '0 * * * *'

  # Allows you to run this workflow manually from the Actions tab.
  workflow_dispatch:

jobs:
  elementary:
    runs-on: ubuntu-latest
    steps:
      - name: Run Elementary
        uses: elementary-data/run-elementary-action@v1
        with:
          warehouse-type: snowflake
          profiles-yml: ${{ secrets.PROFILES_YML }}
          edr-command: edr monitor report --file-path index.html

      - name: Commit report
        uses: EndBug/add-and-commit@v9.1.0
        with:
          message: "Updated Elementary's report."

How does that sound to you?
Care to give it a shot and share some insights?

Thanks a lot!
Feel free to let me know if you have any questions.

@courentin
Copy link
Author

Hello @elongl thanks for your answer!

Yes I can definitely do use an action for this, that would work perfectly (and it's actually what's I'm doing for the dbt doc).
That was more an open question about "would there be a benefit of including it directly in the send-report command".

I have not strong opinions on it as above's solution works perfectly fine for me!

@elongl
Copy link
Member

elongl commented Nov 4, 2022

Thanks a lot for this great suggestion, we'll definitely consider that.
For the time being I think we'll settle for GitHub's solution,
just like you're using it with dbt docs, we can apply the same concept with edr monitor report.

@elongl elongl closed this as completed Nov 4, 2022
@Maayan-s
Copy link
Contributor

Maayan-s commented Nov 4, 2022

@elongl Maybe we should add this use case to our docs?

@elongl
Copy link
Member

elongl commented Nov 5, 2022

@Maayan-s Sounds like a great idea!

@courentin Would you perhaps be interested in adding a section to Elementary's docs regarding how you integrated Elementary's report with GitHub Pages? I think it can be an interesting use-case for a lot of users and it seems like you really nailed this mechanism. Let me know what you think 😄

You can do it by clicking the Edit this page on the Share observability report page.

@elongl elongl reopened this Nov 5, 2022
@Maayan-s Maayan-s added Documentation Improvements or additions to documentation Good First Issue 🥇 Good for newcomers Open to contribution 🧡 and removed help wanted Feature Request 💡 labels Nov 5, 2022
@elongl
Copy link
Member

elongl commented Nov 6, 2022

I recently noted that there's a very popular action that deploys to GitHub Pages. Maybe worth looking into it and understand the difference.

@elongl elongl closed this as completed Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Good First Issue 🥇 Good for newcomers Open to contribution 🧡
Projects
None yet
Development

No branches or pull requests

3 participants