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

[REF] Move appzi and plausible to the gh pages build #400

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

surchs
Copy link
Contributor

@surchs surchs commented Dec 13, 2024

Changes proposed in this pull request:

  • move scripts into the GH build process
  • This is the simples (aka dumbest) possible way to achieve this goal. A slightly smarter way would be to have a custom hook that can attach these scripts based on some env variables

NOTE: If this pull request is to be released, the release label must be applied once the review process is done to avoid the local and remote from going out of sync as a consequence of the bump version workflow run

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass
  • If the PR changes the participant-level and/or the dataset-level result file, the query-tool-results files in the neurobagel_examples repo have been regenerated

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Summary by Sourcery

Build:

  • Move Appzi and Plausible scripts to the GitHub Pages build process by adding them during the deployment workflow.

Copy link

sourcery-ai bot commented Dec 13, 2024

Reviewer's Guide by Sourcery

This PR refactors how third-party scripts (Appzi and Plausible) are injected into the application by moving them from being statically defined in the HTML to being dynamically injected during the GitHub Pages build process. The implementation uses a simple sed command in the deployment workflow to replace a placeholder comment with the actual script tags.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Refactor third-party script injection mechanism
  • Remove static script tags from the base HTML file
  • Add placeholder comment for script injection
  • Move script tags to the end of the HTML file as a template
  • Add new build step to inject scripts during deployment
index.html
.github/workflows/deploy.yaml
Update GitHub Actions deployment workflow
  • Add new step to inject production scripts using sed command
  • Include TODO comment about potential future improvements
.github/workflows/deploy.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#399 Remove plausible from docker build process
#399 Keep plausible in GitHub Pages build

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for neurobagel-query ready!

Name Link
🔨 Latest commit 7a3a443
🔍 Latest deploy log https://app.netlify.com/sites/neurobagel-query/deploys/675cc5e831cd03000709c319
😎 Deploy Preview https://deploy-preview-400--neurobagel-query.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@surchs surchs added release Create a release when this PR is merged pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) and removed release Create a release when this PR is merged labels Dec 13, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @surchs - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The scripts are being injected after the closing tag which isn't valid HTML. Consider keeping them within the tag or at least within the HTML document structure.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

.github/workflows/deploy.yaml Show resolved Hide resolved
@rmanaem rmanaem self-requested a review December 16, 2024 17:03
Copy link
Contributor

@rmanaem rmanaem left a comment

Choose a reason for hiding this comment

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

🧑‍🍳

@surchs surchs merged commit 5983dc8 into main Dec 17, 2024
13 checks passed
@surchs surchs deleted the issue399 branch December 17, 2024 15:07
Copy link
Contributor

🚀 PR was released in v0.8.0 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't include plausible ID in docker build
2 participants