Comments (4)
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)
from steampipe-mod-github-sherlock.
Thanks! I'll try this next.
from steampipe-mod-github-sherlock.
@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.
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)
- v0.2
- use https version of git clone HOT 1
- Steampipe sherlock controls fail due to internal desc = 'List' call is missing HOT 1
- Organization Best Practices controls should handle reason coming as <nil> for edge cases HOT 2
- control.private_repo_no_outside_collaborators evaluates <nil> in reason
- v0.3
- Optimize ad-hoc queries to use 'in' operator
- Update readme to add console output
- enable restriction to repos matching a pattern HOT 2
- Update index doc and README for Steampipe v0.14.0 release HOT 2
- Update mod to be compatible with forth-coming GraphQL changes in GitHub plugin.
- Update to take into account column changes in plugin HOT 1
- Error in control "No outside collaborators should have access in each private repository": pq: missing FROM-clause entry for table "r" HOT 1
- Deprecate mod and move applicable checks into GitHub Insights mod
- Update mod.sp to address deprecation warning
- Duplicate local variable error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from steampipe-mod-github-sherlock.