[go: nahoru, domu]

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

misc: add git3po scripts #10231

Merged
merged 8 commits into from
Jan 23, 2020
Merged

misc: add git3po scripts #10231

merged 8 commits into from
Jan 23, 2020

Conversation

paulirish
Copy link
Member

fixes #10192


old approach..

i have many lines of this in a every-five-minutes.sh that's run via cron:

env GIT3PO_GH_TOKEN=<token> node bin/git3po.js -c lighthouserules/rule1.yaml

new approach after this lands..

replace those lines with this:

npm install -g git3po

cd ~/code/lighthouse/lighthouse-core/scripts/git3po-rules

for f in $(ls); do 
  env GIT3PO_GH_TOKEN=<token> git3po -c $f 
done

does that sound right @connorjclark @patrickhulce ?

Copy link
Collaborator
@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

will npm install also upgrade to the latest version? if so, lgtm

@patrickhulce noticing some limitation wrt how startAt works. Ideally, for this use case, we'd want to not define a startAt, and have git3po write to memory somewhere (for each config) the last updated ts for the last issue it handled. Previously, @paulirish was updating startAt periodically so that the issue lookup didn't take too long. Would be nice if git3po could just read that from memory.

@connorjclark
Copy link
Collaborator

can you add a bash file to run these too?

@paulirish
Copy link
Member Author

can you add a bash file to run these too?

good call done.


npm install -g git3po

find git3po-rules/*.yaml -exec git3po -c {} \;
Copy link
Collaborator

Choose a reason for hiding this comment

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

love it

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can now remove startAt from all the configs and do

--start-at=`date "+%s" -d "1 hour ago"`

although the autolock one should be special-cased to 1 month ago

Copy link
Member Author

Choose a reason for hiding this comment

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

k we do this in a followup.

Copy link
Collaborator
@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

does that sound right @connorjclark @patrickhulce ?

Might want to use a different clone that's always pristine and fetches latest master, but ya SGTM 👍

will npm install also upgrade to the latest version? if so, lgtm

ya it should

Ideally, for this use case, we'd want to not define a startAt, and have git3po write to memory somewhere (for each config) the last updated ts for the last issue it handled. Previously, @paulirish was updating startAt periodically so that the issue lookup didn't take too long. Would be nice if git3po could just read that from memory.

Yeah I think I even had a branch of something like this a long time ago circa 2017 and paul wanted something better too (patrickhulce/git3po#5) I think we might just want an option to rewrite the latest issue timestamp back to the yaml file as startAt? otherwise it's kinda weird how we juggle what key we use for which file and whatnot

@connorjclark
Copy link
Collaborator

writing back to yaml seems fine I guess. but a --start-at config option (combined with date) is also good enough IMO. Would allow us to omit startAt from the config, do an initial first-pass with an early date for new conifgs, and use "1 hour ago" or w/e for the cron job. No need to persist.

$lt: 2
actions:
- type: add_comment
body: 'Howdy chief! Appreciate you filing this bug. :clap:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
body: 'Howdy chief! Appreciate you filing this bug. :clap:
body: 'Howdy! Appreciate you filing this bug. :clap:

I think we should remove "chief" from all of these.

Copy link
Member Author

Choose a reason for hiding this comment

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

i <3 "chief"

@@ -0,0 +1,16 @@
repo: GoogleChrome/lighthouse
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI I added this.

@@ -0,0 +1,21 @@
repo: GoogleChrome/lighthouse
Copy link
Collaborator

Choose a reason for hiding this comment

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

i added this

@connorjclark
Copy link
Collaborator
connorjclark commented Jan 21, 2020

remove-needs-priority.yaml

repo: GoogleChrome/lighthouse
filters:
  - type: issue
    criteria:
      state: open
      labels:
        $and:
          - $includes: needs-priority
          - $or:
            - $includes: P0
            - $includes: P1
            - $includes: P1.5
            - $includes: P2
            - $includes: P3
actions:
  - type: remove_label
    label: needs-priority

add-needs-priority.yaml

repo: GoogleChrome/lighthouse
filters:
  - type: issue
    criteria:
      state: open
      labels:
        $not:
          $or:
            - $includes: needs-priority
            - $includes: P0
            - $includes: P1
            - $includes: P1.5
            - $includes: P2
            - $includes: P3
actions:
  - type: add_label
    label: needs-priority

This reverts commit f226b4d.
This reverts commit 3c67c56.
@paulirish
Copy link
Member Author

i reverted your additions. lets add them back once merged. that way we can verify this whole new setup works off the latest stuff.

@connorjclark connorjclark merged commit 84cc7aa into master Jan 23, 2020
@connorjclark connorjclark deleted the git3po branch January 23, 2020 21:25
@paulirish
Copy link
Member Author
paulirish commented Jan 23, 2020

ok it's set up on my side. 👍

cronjob runs every 5 minutes. it updates a checkout of lighthouse to master and runs run-git3po.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

keep git3po configs in this repo
4 participants