Giter VIP home page Giter VIP logo

Comments (12)

ianwesleyarmstrong avatar ianwesleyarmstrong commented on June 13, 2024 1

Of course! I have some thoughts about the developer experience if you would be interested.

It looks like it's cleared up as far as I can tell. I have a few more PR's out that I would like to check before closing for good

from gitstream.

ShakedZrihen avatar ShakedZrihen commented on June 13, 2024 1

Ill be happy to hear from you!
This is my email: [email protected]

You can send me email and we can schedule a call with the product team/ open some chat with them :)

from gitstream.

ianwesleyarmstrong avatar ianwesleyarmstrong commented on June 13, 2024 1

I'm getting a similar bug where GitStream runs in the first commit of a PR, but on any subsequent commits it shows the GitStream check as skipped. Would you like me to open another issue or continue here?

@vim-zz

from gitstream.

ShakedZrihen avatar ShakedZrihen commented on June 13, 2024

@ianwesleyarmstrong can you please attach here your gitstream.cm file + repository and PR number?

thanks!

from gitstream.

ianwesleyarmstrong avatar ianwesleyarmstrong commented on June 13, 2024

Thanks! The repo is opencareer/tf-infra and it started on PR #75. On the newer PR's it is showing as successful, but the workflow isn't actually getting triggered.

gitstream.cm

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  welcome_message:
    if:
      - {{ repo.contributors | isFirstCommit(branch.author) }}
    run:
      - action: add-comment@v1
        args:
          comment: |
            Welcome @{{ pr.author }}!

  estimated_time_to_review:
    if:
      - true
    run:
      - action : add-label@v1
        args:
          label: '{{ calc.etr }} min review'
          color: {{ 'E94637' if (calc.etr >= 20) else ('FBBD10' if (calc.etr >= 5) else '36A853') }}

  safe_changes:
    # The `if` key has a list of conditions, each condition is specified as a Jinja expression
    # in a double curly braces. Expressions are evaluated by gitStream on a PR when triggered.
    if:
      # Given the PR code changes, check that only formatting changes were made
      - {{ is.formatting or is.docs or is.tests }}
    # `run` key has a list of actions, which are executed one by one whenever the automation
    # conditions are met.
    run:
      # When the changes are validated as formatting only, you can help to speed up the review
      # by adding a label that marks it accordingly.
      - action: add-label@v1
        args:
          label: 'safe-changes'
      # You can uncomment the following action to get gitStream can even automatically approve
      # such PRs to save reviewers time for such changes.
      # - action: approve@v1

  admin_autoapprove:
    if:
      - {{ is.admin }}
    run:
      - action: approve@v1

  review_cicd:
    if:
      - {{ files | match(regex=r/.github\/workflows\/.*\.yml/) | some }}
    run:
      - action: add-reviewers@v1
        args:
          team_reviewers: [infrastructure]

  snowflake_access:
    if:
      - {{ is.snowflake_access }}
    run:
      - action: add-reviewers@v1
        args:
          team_reviewers: [snowflake-infrastructure]
      - action: add-comment@v1
        args:
          comment: |
            Snowflake ...

  aws_changes:
    if:
      - {{ is.aws and not is.admin }}
    run:
      - action: add-label@v1
        args:
          label: 'aws'
      - action: add-reviewers@v1
        args:
          team_reviewers: [aws-infrastructure]

  snowflake_changes:
    if:
      - {{ is.snowflake and not is.admin }}
    run:
      - action: add-label@v1
        args:
          label: 'snowflake'
      - action: add-reviewers@v1
        args:
          team_reviewers: [snowflake-infrastructure]

calc:
  etr: {{ branch | estimatedReviewTime }}
is:
  formatting: {{ source.diff.files | isFormattingChange }}
  docs: {{ files | allDocs }}
  tests: {{ files | allTests }}
  terragrunt: {{ files | match(regex=r/(...)\/terragrunt.hcl/) | some }}
  admin: {{ pr.author | includes(list=['ianwesleyarmstrong']) }}
  aws: {{ files | match(regex=r/aws\/(...)/) | some }}
  snowflake: {{ files | match(regex=r/snowflake\/(...)/) | some }}
  snowflake_access: {{ files | match(regex=r/(...)\/(roles)|(users)\.yaml/) | some }}

from gitstream.

ianwesleyarmstrong avatar ianwesleyarmstrong commented on June 13, 2024

i'm now running into this error as well:

Running tag v1.76
Already on 'share-refresh'
Already on 'share-refresh'
ARGS:  { regex: /.github\/workflows\/.*\.yml/, __keywords: true }
ARGS:  { regex: /(...)\/terragrunt.hcl/, __keywords: true }
/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:577
    return file.includes(term);
                ^

TypeError: Cannot read properties of null (reading 'includes')
    at /node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:577:17
    at Array.some (<anonymous>)
    at Context.parseIncludes (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:576:114)
    at eval (eval at _compile (/node_modules/nunjucks/src/environment.js:633:18), <anonymous>:38:59)
    at _callee$ (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:778:13)
    at tryCatch (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:96:17)
    at Generator._invoke (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:76:24)
    at Generator.next (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:127:21)
    at asyncGeneratorStep (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:360:24)
    at _next (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:382:9)

from gitstream.

yeelali14 avatar yeelali14 commented on June 13, 2024

@ianwesleyarmstrong Hi, is it possible to also add the following automation to the gitstream.cm file?
Commit to main branch and merge it to the HEAD branch and share the results here?

  debug_context:
    if:
      - true
    run:
      - action: add-comment@v1
        args:
          comment: |
            {{ pr | dump | safe }}

Here is the complete gitstream.cm:


manifest:
  version: 1.0

automations:
  welcome_message:
    if:
      - {{ repo.contributors | isFirstCommit(branch.author) }}
    run:
      - action: add-comment@v1
        args:
          comment: |
            Welcome @{{ pr.author }}!

  estimated_time_to_review:
    if:
      - true
    run:
      - action : add-label@v1
        args:
          label: '{{ calc.etr }} min review'
          color: {{ 'E94637' if (calc.etr >= 20) else ('FBBD10' if (calc.etr >= 5) else '36A853') }}

  safe_changes:
    # The `if` key has a list of conditions, each condition is specified as a Jinja expression
    # in a double curly braces. Expressions are evaluated by gitStream on a PR when triggered.
    if:
      # Given the PR code changes, check that only formatting changes were made
      - {{ is.formatting or is.docs or is.tests }}
    # `run` key has a list of actions, which are executed one by one whenever the automation
    # conditions are met.
    run:
      # When the changes are validated as formatting only, you can help to speed up the review
      # by adding a label that marks it accordingly.
      - action: add-label@v1
        args:
          label: 'safe-changes'
      # You can uncomment the following action to get gitStream can even automatically approve
      # such PRs to save reviewers time for such changes.
      # - action: approve@v1

  admin_autoapprove:
    if:
      - {{ is.admin }}
    run:
      - action: approve@v1

  review_cicd:
    if:
      - {{ files | match(regex=r/.github\/workflows\/.*\.yml/) | some }}
    run:
      - action: add-reviewers@v1
        args:
          team_reviewers: [infrastructure]

  snowflake_access:
    if:
      - {{ is.snowflake_access }}
    run:
      - action: add-reviewers@v1
        args:
          team_reviewers: [snowflake-infrastructure]
      - action: add-comment@v1
        args:
          comment: |
            Snowflake ...

  aws_changes:
    if:
      - {{ is.aws and not is.admin }}
    run:
      - action: add-label@v1
        args:
          label: 'aws'
      - action: add-reviewers@v1
        args:
          team_reviewers: [aws-infrastructure]

  snowflake_changes:
    if:
      - {{ is.snowflake and not is.admin }}
    run:
      - action: add-label@v1
        args:
          label: 'snowflake'
      - action: add-reviewers@v1
        args:
          team_reviewers: [snowflake-infrastructure]
  debug_context:
    if:
      - true
    run:
      - action: add-comment@v1
        args:
          comment: |
            {{ pr | dump | safe }}

calc:
  etr: {{ branch | estimatedReviewTime }}
is:
  formatting: {{ source.diff.files | isFormattingChange }}
  docs: {{ files | allDocs }}
  tests: {{ files | allTests }}
  terragrunt: {{ files | match(regex=r/(...)\/terragrunt.hcl/) | some }}
  admin: {{ pr.author | includes(list=['ianwesleyarmstrong']) }}
  aws: {{ files | match(regex=r/aws\/(...)/) | some }}
  snowflake: {{ files | match(regex=r/snowflake\/(...)/) | some }}
  snowflake_access: {{ files | match(regex=r/(...)\/(roles)|(users)\.yaml/) | some }}

Thanks!

from gitstream.

ianwesleyarmstrong avatar ianwesleyarmstrong commented on June 13, 2024

Hi,

The workflow is breaking before the rules can finish evaluating. I am adding a new directory/file, so maybe its erroring out on some kind of file diff?

EDIT:

I opened up another PR with just a whitespace change and the same error popped up as well

docker.io/gitstream/rules-engine:latest

> [email protected] start
> node src/app.js

Running tag v1.76
Switched to branch 'main'
Switched to branch '***'
fatal: no such path snowflake/et27231/us-east-2/production/databases/***/terragrunt.hcl in main
ARGS:  { regex: /.github\/workflows\/.*\.yml/, __keywords: true }
ARGS:  { regex: /(...)\/terragrunt.hcl/, __keywords: true }
/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:577
    return file.includes(term);
                ^

TypeError: Cannot read properties of null (reading 'includes')
    at /node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:577:17
    at Array.some (<anonymous>)
    at Context.parseIncludes (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:576:114)
    at eval (eval at _compile (/node_modules/nunjucks/src/environment.js:633:18), <anonymous>:44:59)
    at _callee$ (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:778:13)
    at tryCatch (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:96:17)
    at Generator._invoke (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:76:24)
    at Generator.next (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:127:21)
    at asyncGeneratorStep (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:360:24)
    at _next (/node_modules/@linearb/gitstream-rule-parser/dist/gitstream-rule-parser.cjs.development.js:382:9)

from gitstream.

ShakedZrihen avatar ShakedZrihen commented on June 13, 2024

hello again!
first of all -> Im happy that you are trying our tool :) we are still in early stages so we are more than happy to get inputs from users.
I pushed a fix to a problem we had in this area and I can't reproduced this bug anymore in my repository.
Can you try again and let me know if it fixed at your end as well?

Thanks,
Shaked

from gitstream.

ianwesleyarmstrong avatar ianwesleyarmstrong commented on June 13, 2024

Just saw this pop up again under similar circumstances

/home/runner/work/_temp/d9d2aa2b-8a68-458f-ab85-3791bc7cfb7b.sh: line 10: unexpected EOF while looking for matching ''`

from gitstream.

ShakedZrihen avatar ShakedZrihen commented on June 13, 2024

hi @ianwesleyarmstrong !
I found something that may cause that issue, I pushed a fix and ill be happy if you could try trigger the action again by a dummy commit or something like that (not a re-run).

from gitstream.

vim-zz avatar vim-zz commented on June 13, 2024

iā€™m closing this bug, @ianwesleyarmstrong if you still get this issue feel free to reopen it or open a new issue

from gitstream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.