Giter Club home page Giter Club logo

Comments (4)

judell avatar judell commented on June 1, 2024 1

Here's a thing you can do that isn't yet in the published mod.

First, add a variable. It can go into any of the .sp files because variables are scoped to the mod. Here's mine in issue.sp.

variable "repo_name_regex" {
  type        = string
  description = "A regex pattern to scope the set of repos to check. Press Enter to check all."
}

Then use it in the controls. Here's the only place where I've used it so far.

control "issue_older_30_days" {
  title = "Issues should not be open longer than 30 days"
  description = "Issues should be resolved or closed in a timely manner."
  sql = <<-EOT
    select
      i.html_url as resource,
      case
        when i.created_at <= (current_date - interval '30' day) then 'alarm'
        else 'ok'
      end as status,
      '#' || i.issue_number || ' ' || i.title || ' created ' || to_char(i.created_at , 'DD-Mon-YYYY') ||
        ' (' || extract(day from current_timestamp - i.created_at) || ' days).' as reason,
      i.repository_full_name
    from
      github_my_repository as r
      left join github_issue as i on r.full_name = i.repository_full_name
    where
      r.fork = ${local.include_forks} and i.state = 'open'
      and r.full_name ~ '${var.repo_name_regex}'   -- this is the new bit
  EOT
}

Now when I do this:

steampipe check control.issue-older-30-day

Steampipe says:

Variables defined with no value set.
var.repo_name_regex
  A regex pattern to scope the set of repos to check. Press Enter to check all.

  Enter a value:

I say: turbot/steampipe-(plugin|mod)

image

from steampipe-mod-github-sherlock.

vielmetti avatar vielmetti commented on June 1, 2024

Thanks! I'll try this next.

from steampipe-mod-github-sherlock.

rajlearner17 avatar rajlearner17 commented on June 1, 2024

@vielmetti just wanting to know if you tried this and have any other issues faced? The "ERROR: context deadline exceeded" is addressed already.
@judell anything we need to work out here or we close this issue?

from steampipe-mod-github-sherlock.

rajlearner17 avatar rajlearner17 commented on June 1, 2024

Marking this closed, as the plugin is addressed with the latest SDK updates. Re-open if necessary.

from steampipe-mod-github-sherlock.

Related Issues (17)

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.