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

Optimize ad-hoc queries to use 'in' operator #Closes 25 #26

Merged
merged 1 commit into from
Jan 5, 2022
Merged

Conversation

bigdatasourav
Copy link
Contributor

@bigdatasourav bigdatasourav commented Jan 3, 2022

Result

> select
      r.full_name as resource,
      case
        when b.allow_force_pushes_enabled = 'false' then 'ok'
        else 'alarm'
      end as status,
      r.full_name || ' default branch ' || b.name ||
        case
          when b.allow_force_pushes_enabled = 'false' then ' prevents force push.'
          when b.allow_force_pushes_enabled = 'true' then ' allows force push.'
          -- If not false or true, then null, which means no branch protection rule exists
          else ' is not protected.'
        end as reason,
      r.full_name
    from
      github_my_repository as r
      left join github_branch_protection as b on r.full_name = b.repository_full_name
    where
      visibility = 'public' and r.fork = false and b.name in ('main', 'master')
+---------------------------+--------+------------------------------------------------------------------+---------------------------+
| resource                  | status | reason                                                           | full_name                 |
+---------------------------+--------+------------------------------------------------------------------+---------------------------+
| bigdatasourav/turbot-test | alarm  | bigdatasourav/turbot-test default branch main allows force push. | bigdatasourav/turbot-test |
+---------------------------+--------+------------------------------------------------------------------+---------------------------+

@bigdatasourav bigdatasourav self-assigned this Jan 3, 2022
@bigdatasourav bigdatasourav linked an issue Jan 3, 2022 that may be closed by this pull request
Copy link
Contributor

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

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

LGTM

@misraved misraved merged commit 2159a54 into main Jan 5, 2022
@misraved misraved deleted the issue-25 branch January 5, 2022 15:14
@misraved misraved restored the issue-25 branch January 5, 2022 15:15
misraved added a commit that referenced this pull request Jan 5, 2022
@cbruno10 cbruno10 deleted the issue-25 branch April 29, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize ad-hoc queries to use 'in' operator
3 participants