Skip to content

feat: Allow plugin to run onSuccess with toml setting or env var LIGHTHOUSE_RUN_ON_SUCCESS #570

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 1 commit into from
Apr 13, 2023

Conversation

aitchiss
Copy link
Contributor

@aitchiss aitchiss commented Apr 13, 2023

(went for a long PR title just for the sake of the changelog since we're going to cut a release with this)

Renames the env var to run on success to make this ready for experimental use.

Steps to validate:

  • Using the plugin version at this branch, run a deploy for a site without adding any env variables/inputs for run_on_success. Plugin should run onPostBuild as before
  • Set run_on_success to 'true' in the site's toml file and deploy. Plugin should run on success and results should be shown in the UI when ready
  • Remove the toml setting and set an environment variable for your site LIGHTHOUSE_RUN_ON_SUCCESS='TRUE'. Plugin should run on success and results should be shown in the UI when ready

@aitchiss aitchiss requested review from a team and jackbrewer April 13, 2023 12:29
@netlify
Copy link

netlify bot commented Apr 13, 2023

👷 Deploy Preview for plugin-lighthouse processing.

Name Link
🔨 Latest commit 48830d9
🔍 Latest deploy log https://app.netlify.com/sites/plugin-lighthouse/deploys/6437f5b679b0690008ec01a4

@@ -6,9 +6,10 @@ import getUtils from './lib/get-utils/index.js';
dotenv.config();

export default function lighthousePlugin(inputs) {
// Run onPostBuild by default, unless RUN_ON_SUCCESS is set to true
// Run onPostBuild by default, unless LIGHTHOUSE_RUN_ON_SUCCESS env var is set to true, or run_on_success is specified in plugin inputs
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 noticed we have an inputs option for run_on_success and in the end I felt like at that level it made sense not to prefix with lighthouse_, but happy to change to match the env var if preferred (I was on the fence 😄 )

@aitchiss aitchiss changed the title feat: Allow plugin to run onSuccess with env var LIGHTHOUSE_RUN_ON_SUCCESS feat: Allow plugin to run onSuccess with toml setting or env var LIGHTHOUSE_RUN_ON_SUCCESS Apr 13, 2023
Copy link
Contributor

@jackbrewer jackbrewer left a comment

Choose a reason for hiding this comment

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

All looking good! 🚀

We should remember to test through UI installation once the new version is available too

@aitchiss
Copy link
Contributor Author

All looking good! 🚀

We should remember to test through UI installation once the new version is available too

Good point!

@aitchiss aitchiss merged commit 7de67f4 into main Apr 13, 2023
@aitchiss aitchiss deleted the sa/chore/renameRunOnSuccessEnvVar branch April 13, 2023 14:16
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