From b3e55d3902eda0b8f3d485f8a614feea55c6e8a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Dec 2024 16:32:48 +0330 Subject: [PATCH] fix: fixed dockerfile --- go.mod | 18 +- go.sum | 22 ++ pkg/sdk/es/resources_clients.go | 80 +++++- provider/describer/artifact_dockerfile.go | 233 ++++++------------ provider/model/model.go | 194 +-------------- .../table_github_artifact_dockerfile.go | 5 + .../table_github_pull_request_comment.go | 1 - .../table_github_pull_request_review.go | 1 - 8 files changed, 187 insertions(+), 367 deletions(-) diff --git a/go.mod b/go.mod index 473ec0b2..f1f59096 100755 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/nats-io/nats.go v1.36.0 github.com/opengovern/og-util v1.3.0 github.com/opengovern/opencomply v0.475.2 - github.com/opengovern/resilient-bridge v0.0.0-20241217072313-40e2d7a377f6 + github.com/opengovern/resilient-bridge v0.0.0-20241223034530-c671a04130ef github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7 github.com/spf13/cobra v1.8.1 github.com/turbot/steampipe-plugin-github v1.0.0 @@ -76,14 +76,15 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudflare/circl v1.3.8 // indirect - github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect + github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect + github.com/containerd/typeurl/v2 v2.2.3 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect - github.com/docker/cli v27.1.1+incompatible // indirect + github.com/docker/cli v27.4.0-rc.2+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker-credential-helpers v0.7.0 // indirect + github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/eko/gocache/lib/v4 v4.1.5 // indirect github.com/eko/gocache/store/bigcache/v4 v4.2.1 // indirect @@ -138,7 +139,7 @@ require ( github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/labstack/gommon v0.4.2 // indirect github.com/leodido/go-urn v1.4.0 // indirect @@ -149,6 +150,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/buildkit v0.18.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -163,6 +165,7 @@ require ( github.com/pganalyze/pg_query_go/v4 v4.2.3 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect @@ -178,7 +181,7 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect - github.com/vbatts/tar-split v0.11.3 // indirect + github.com/vbatts/tar-split v0.11.5 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/zclconf/go-cty v1.14.4 // indirect go.opencensus.io v0.24.0 // indirect @@ -197,7 +200,7 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.29.0 // indirect - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/sync v0.9.0 // indirect golang.org/x/sys v0.27.0 // indirect @@ -214,6 +217,7 @@ require ( k8s.io/client-go v0.31.2 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 // indirect + oras.land/oras-go/v2 v2.5.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/go.sum b/go.sum index 95e9bda1..eda69191 100644 --- a/go.sum +++ b/go.sum @@ -309,6 +309,10 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= +github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= +github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= +github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40= +github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= @@ -327,10 +331,14 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE= github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v27.4.0-rc.2+incompatible h1:A0GZwegDlt2wdt3tpmrUzkVOZmbhvd7i05wPSf7Oo74= +github.com/docker/cli v27.4.0-rc.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= +github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= +github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= @@ -599,6 +607,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -647,6 +657,8 @@ github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/buildkit v0.18.2 h1:l86uBvxh4ntNoUUg3Y0eGTbKg1PbUh6tawJ4Xt75SpQ= +github.com/moby/buildkit v0.18.2/go.mod h1:vCR5CX8NGsPTthTg681+9kdmfvkvqJBXEv71GZe5msU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -679,6 +691,8 @@ github.com/opengovern/opencomply v0.475.2 h1:JHs12+mhJb9HzFZYMLLgw079PRa+qLKntug github.com/opengovern/opencomply v0.475.2/go.mod h1:FsJTfdLz+DDRAzW2/KyCFRxVxM89jMysP7ZfQjaS8+A= github.com/opengovern/resilient-bridge v0.0.0-20241217072313-40e2d7a377f6 h1:9IEO50lNreg+kMPgWq5RU3/4cMDLbT3KMjJ1GlZUJds= github.com/opengovern/resilient-bridge v0.0.0-20241217072313-40e2d7a377f6/go.mod h1:zEulaGgccj5tPXGiudGz17NRhXAk2HHh+GPj2VkjNq0= +github.com/opengovern/resilient-bridge v0.0.0-20241223034530-c671a04130ef h1:RbmIvOlEvYAZkqlc90sUQrYkPBe94q35ONEE9wlyUyQ= +github.com/opengovern/resilient-bridge v0.0.0-20241223034530-c671a04130ef/go.mod h1:zEulaGgccj5tPXGiudGz17NRhXAk2HHh+GPj2VkjNq0= github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ= github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8= github.com/pganalyze/pg_query_go/v4 v4.2.3 h1:cNLqyiVMasV7YGWyYV+fkXyHp32gDfXVNCqoHztEGNk= @@ -688,6 +702,8 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjL github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -777,6 +793,8 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= +github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= +github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -857,6 +875,8 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1419,6 +1439,8 @@ k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 h1:MErs8YA0abvOqJ8gIupA1T k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094/go.mod h1:7ioBJr1A6igWjsR2fxq2EZ0mlMwYLejazSIc2bzMp2U= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c= +oras.land/oras-go/v2 v2.5.0/go.mod h1:z4eisnLP530vwIOUOJeBIj0aGI0L1C3d53atvCBqZHg= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/pkg/sdk/es/resources_clients.go b/pkg/sdk/es/resources_clients.go index 0fc061a6..20cd24bc 100644 --- a/pkg/sdk/es/resources_clients.go +++ b/pkg/sdk/es/resources_clients.go @@ -1188,9 +1188,42 @@ func (p BranchProtectionPaginator) NextPage(ctx context.Context) ([]BranchProtec } var listBranchProtectionFilters = map[string]string{ - "id": "Description.Id", - "node_id": "Description.NodeId", - "repository_full_name": "Description.RepoFullName", + "allows_deletions": "Description.AllowsDeletions", + "allows_force_pushes": "Description.AllowsForcePushes", + "blocks_creations": "Description.BlocksCreations", + "bypass_force_push_allowance_apps": "Description.BypassForcePushAllowanceApps", + "bypass_force_push_allowance_teams": "Description.BypassForcePushAllowanceTeams", + "bypass_force_push_allowance_users": "Description.BypassForcePushAllowanceUsers", + "bypass_pull_request_allowance_apps": "Description.BypassPullRequestAllowanceApps", + "bypass_pull_request_allowance_teams": "Description.BypassPullRequestAllowanceTeams", + "bypass_pull_request_allowance_users": "Description.BypassPullRequestAllowanceUsers", + "creator_login": "Description.CreatorLogin", + "dismisses_stale_reviews": "Description.DismissesStaleReviews", + "id": "Description.Id", + "is_admin_enforced": "Description.IsAdminEnforced", + "lock_allows_fetch_and_merge": "Description.LockAllowsFetchAndMerge", + "lock_branch": "Description.LockBranch", + "matching_branches": "Description.MatchingBranches", + "node_id": "Description.NodeId", + "pattern": "Description.Pattern", + "push_allowance_apps": "Description.PushAllowanceApps", + "push_allowance_teams": "Description.PushAllowanceTeams", + "push_allowance_users": "Description.PushAllowanceUsers", + "repository_full_name": "Description.RepoFullName", + "require_last_push_approval": "Description.RequireLastPushApproval", + "required_approving_review_count": "Description.RequiredApprovingReviewCount", + "required_deployment_environments": "Description.RequiredDeploymentEnvironments", + "required_status_checks": "Description.RequiredStatusChecks", + "requires_approving_reviews": "Description.RequiresApprovingReviews", + "requires_code_owner_reviews": "Description.RequiresCodeOwnerReviews", + "requires_commit_signatures": "Description.RequiresCommitSignatures", + "requires_conversation_resolution": "Description.RequiresConversationResolution", + "requires_deployments": "Description.RequiresDeployments", + "requires_linear_history": "Description.RequiresLinearHistory", + "requires_status_checks": "Description.RequiresStatusChecks", + "requires_strict_status_checks": "Description.RequiresStrictStatusChecks", + "restricts_pushes": "Description.RestrictsPushes", + "restricts_review_dismissals": "Description.RestrictsReviewDismissals", } func ListBranchProtection(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -1254,9 +1287,42 @@ func ListBranchProtection(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getBranchProtectionFilters = map[string]string{ - "id": "Description.Id", - "node_id": "Description.NodeId", - "repository_full_name": "Description.RepoFullName", + "allows_deletions": "Description.AllowsDeletions", + "allows_force_pushes": "Description.AllowsForcePushes", + "blocks_creations": "Description.BlocksCreations", + "bypass_force_push_allowance_apps": "Description.BypassForcePushAllowanceApps", + "bypass_force_push_allowance_teams": "Description.BypassForcePushAllowanceTeams", + "bypass_force_push_allowance_users": "Description.BypassForcePushAllowanceUsers", + "bypass_pull_request_allowance_apps": "Description.BypassPullRequestAllowanceApps", + "bypass_pull_request_allowance_teams": "Description.BypassPullRequestAllowanceTeams", + "bypass_pull_request_allowance_users": "Description.BypassPullRequestAllowanceUsers", + "creator_login": "Description.CreatorLogin", + "dismisses_stale_reviews": "Description.DismissesStaleReviews", + "id": "Description.Id", + "is_admin_enforced": "Description.IsAdminEnforced", + "lock_allows_fetch_and_merge": "Description.LockAllowsFetchAndMerge", + "lock_branch": "Description.LockBranch", + "matching_branches": "Description.MatchingBranches", + "node_id": "Description.NodeId", + "pattern": "Description.Pattern", + "push_allowance_apps": "Description.PushAllowanceApps", + "push_allowance_teams": "Description.PushAllowanceTeams", + "push_allowance_users": "Description.PushAllowanceUsers", + "repository_full_name": "Description.RepoFullName", + "require_last_push_approval": "Description.RequireLastPushApproval", + "required_approving_review_count": "Description.RequiredApprovingReviewCount", + "required_deployment_environments": "Description.RequiredDeploymentEnvironments", + "required_status_checks": "Description.RequiredStatusChecks", + "requires_approving_reviews": "Description.RequiresApprovingReviews", + "requires_code_owner_reviews": "Description.RequiresCodeOwnerReviews", + "requires_commit_signatures": "Description.RequiresCommitSignatures", + "requires_conversation_resolution": "Description.RequiresConversationResolution", + "requires_deployments": "Description.RequiresDeployments", + "requires_linear_history": "Description.RequiresLinearHistory", + "requires_status_checks": "Description.RequiresStatusChecks", + "requires_strict_status_checks": "Description.RequiresStrictStatusChecks", + "restricts_pushes": "Description.RestrictsPushes", + "restricts_review_dismissals": "Description.RestrictsReviewDismissals", } func GetBranchProtection(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -7288,6 +7354,7 @@ var listArtifactDockerFileFilters = map[string]string{ "dockerfile_content_base64": "Description.DockerfileContentBase64", "git_url": "Description.GitURL", "html_url": "Description.HTMLURL", + "images": "Description.Images", "last_updated_at": "Description.LastUpdatedAt", "name": "Description.Name", "path": "Description.Path", @@ -7361,6 +7428,7 @@ var getArtifactDockerFileFilters = map[string]string{ "dockerfile_content_base64": "Description.DockerfileContentBase64", "git_url": "Description.GitURL", "html_url": "Description.HTMLURL", + "images": "Description.Images", "last_updated_at": "Description.LastUpdatedAt", "name": "Description.Name", "path": "Description.Path", diff --git a/provider/describer/artifact_dockerfile.go b/provider/describer/artifact_dockerfile.go index 8da8db18..329514b4 100644 --- a/provider/describer/artifact_dockerfile.go +++ b/provider/describer/artifact_dockerfile.go @@ -15,19 +15,25 @@ import ( "github.com/opengovern/og-describer-github/provider/model" resilientbridge "github.com/opengovern/resilient-bridge" "github.com/opengovern/resilient-bridge/adapters" + "github.com/opengovern/resilient-bridge/utils" // For ExtractExternalBaseImagesFromBase64 ) // MAX_RESULTS is the maximum number of Dockerfiles to collect or stream. const MAX_RESULTS = 500 -// ListDockerFile lists references to Dockerfiles in all repositories for the given organization. -// If a stream is provided, results are streamed. If not, a slice of resources is returned. +// MAX_DOCKERFILE_LEN is the maximum allowed number of lines in a Dockerfile. +const MAX_DOCKERFILE_LEN = 500 + +// ListArtifactDockerFiles performs a single code search across the organization +// for "filename:Dockerfile" and processes each result. Each Dockerfile is +// streamed immediately upon processing, and also added to the final slice. func ListArtifactDockerFiles( ctx context.Context, githubClient GitHubClient, organizationName string, stream *models.StreamSender, ) ([]models.Resource, error) { + sdk := resilientbridge.NewResilientBridge() sdk.SetDebug(false) sdk.RegisterProvider("github", adapters.NewGitHubAdapter(githubClient.Token), &resilientbridge.ProviderConfig{ @@ -36,130 +42,24 @@ func ListArtifactDockerFiles( BaseBackoff: time.Second, }) - org := ctx.Value("organization") - if org != nil { - orgName := org.(string) - if orgName != "" { + // If org override is in context + if orgVal := ctx.Value("organization"); orgVal != nil { + if orgName, ok := orgVal.(string); ok && orgName != "" { organizationName = orgName } } - repo := ctx.Value("repository") - - if repo != nil { - repoName := repo.(string) - if repoName != "" { - repoFullName := fmt.Sprintf("%s/%s", organizationName, repoName) - return fetchRepositoryDockerfiles(ctx, sdk, githubClient, organizationName, repoFullName, stream) - } - } - - repositories, err := getRepositories(ctx, githubClient.RestClient, organizationName) - if err != nil { - return nil, fmt.Errorf("error fetching repositories for org %s: %w", organizationName, err) - } + // Build a single code search query that searches the entire org for Dockerfiles + // Example: org:my-org filename:Dockerfile + finalQuery := fmt.Sprintf("org:%s filename:Dockerfile", organizationName) var allValues []models.Resource totalCollected := 0 perPage := 100 - - // For each repository, search for Dockerfiles - for _, repo := range repositories { - if totalCollected >= MAX_RESULTS { - break - } - - repoFullName := repo.GetFullName() - queryParts := []string{ - fmt.Sprintf("repo:%s", repoFullName), - "filename:Dockerfile", - } - finalQuery := strings.Join(queryParts, " ") - - page := 1 - for totalCollected < MAX_RESULTS { - q := url.QueryEscape(finalQuery) - searchEndpoint := fmt.Sprintf("/search/code?q=%s&per_page=%d&page=%d", q, perPage, page) - - searchReq := &resilientbridge.NormalizedRequest{ - Method: "GET", - Endpoint: searchEndpoint, - Headers: map[string]string{"Accept": "application/vnd.github+json"}, - } - - searchResp, err := sdk.Request("github", searchReq) - if err != nil { - log.Printf("Error searching code in %s: %v\n", repoFullName, err) - break - } - - if searchResp.StatusCode >= 400 { - log.Printf("HTTP error %d searching code in %s: %s\n", searchResp.StatusCode, repoFullName, string(searchResp.Data)) - break - } - - var result model.CodeSearchResult - if err := json.Unmarshal(searchResp.Data, &result); err != nil { - log.Printf("Error parsing code search response for %s: %v\n", repoFullName, err) - break - } - - // If no items returned, no more results - if len(result.Items) == 0 { - break - } - - for _, item := range result.Items { - resource, err := GetDockerfile(ctx, githubClient, organizationName, item.Repository.FullName, item.Path, stream) - if err != nil { - log.Printf("Skipping %s/%s: %v\n", item.Repository.FullName, item.Path, err) - continue - } - if resource == nil { - // Means it didn't stream anything or some unknown reason - continue - } - - totalCollected++ - if stream != nil { - // Stream the resource - if err := (*stream)(*resource); err != nil { - return nil, fmt.Errorf("error streaming resource: %w", err) - } - } else { - // Accumulate to return later - allValues = append(allValues, *resource) - } - - if totalCollected >= MAX_RESULTS { - break - } - } - - if len(result.Items) < perPage { - // Fewer than perPage results means no more pages - break - } - page++ - } - } - - return allValues, nil -} - -func fetchRepositoryDockerfiles(ctx context.Context, sdk *resilientbridge.ResilientBridge, githubClient GitHubClient, organizationName, repoFullName string, stream *models.StreamSender) ([]models.Resource, error) { - var allValues []models.Resource - totalCollected := 0 - perPage := 100 - - queryParts := []string{ - fmt.Sprintf("repo:%s", repoFullName), - "filename:Dockerfile", - } - finalQuery := strings.Join(queryParts, " ") - page := 1 + for totalCollected < MAX_RESULTS { + // Encode the search query q := url.QueryEscape(finalQuery) searchEndpoint := fmt.Sprintf("/search/code?q=%s&per_page=%d&page=%d", q, perPage, page) @@ -168,49 +68,52 @@ func fetchRepositoryDockerfiles(ctx context.Context, sdk *resilientbridge.Resili Endpoint: searchEndpoint, Headers: map[string]string{"Accept": "application/vnd.github+json"}, } - searchResp, err := sdk.Request("github", searchReq) if err != nil { - log.Printf("Error searching code in %s: %v\n", repoFullName, err) - break + return allValues, fmt.Errorf("error performing code search in org %s: %w", organizationName, err) } - if searchResp.StatusCode >= 400 { - log.Printf("HTTP error %d searching code in %s: %s\n", searchResp.StatusCode, repoFullName, string(searchResp.Data)) - break + return allValues, fmt.Errorf("HTTP error %d searching Dockerfiles in org %s: %s", + searchResp.StatusCode, organizationName, string(searchResp.Data)) } var result model.CodeSearchResult if err := json.Unmarshal(searchResp.Data, &result); err != nil { - log.Printf("Error parsing code search response for %s: %v\n", repoFullName, err) - break + return allValues, fmt.Errorf("error parsing code search response for org %s: %w", organizationName, err) } - // If no items returned, no more results if len(result.Items) == 0 { + // No more results break } + // Process each Dockerfile found for _, item := range result.Items { - resource, err := GetDockerfile(ctx, githubClient, organizationName, item.Repository.FullName, item.Path, stream) + resource, err := GetDockerfile( + ctx, + githubClient, + organizationName, // org name + item.Repository.FullName, // e.g. "my-org/my-repo" + item.Path, // e.g. "path/to/Dockerfile" + stream, + ) if err != nil { log.Printf("Skipping %s/%s: %v\n", item.Repository.FullName, item.Path, err) continue } if resource == nil { - // Means it didn't stream anything or some unknown reason continue } + // 1) Add to our local slice + allValues = append(allValues, *resource) totalCollected++ + + // 2) Stream the Dockerfile result immediately if stream != nil { - // Stream the resource if err := (*stream)(*resource); err != nil { - return nil, fmt.Errorf("error streaming resource: %w", err) + return allValues, fmt.Errorf("error streaming resource: %w", err) } - } else { - // Accumulate to return later - allValues = append(allValues, *resource) } if totalCollected >= MAX_RESULTS { @@ -219,42 +122,47 @@ func fetchRepositoryDockerfiles(ctx context.Context, sdk *resilientbridge.Resili } if len(result.Items) < perPage { - // Fewer than perPage results means no more pages - break + break // no more pages } page++ } + // Return everything, even though we streamed each file already return allValues, nil } -// GetDockerfile fetches the details and content of a single Dockerfile given the repo and file path. -// It returns a fully populated resource with Dockerfile content, line count checks, and last updated at info. -func GetDockerfile(ctx context.Context, githubClient GitHubClient, organizationName, repoFullName, filePath string, stream *models.StreamSender) (*models.Resource, error) { +// GetDockerfile fetches a single Dockerfile from GitHub, decodes the base64 content, +// checks line count, uses `utils.ExtractExternalBaseImagesFromBase64` to parse external images. +// If parse fails, we store an empty Images slice. +func GetDockerfile( + ctx context.Context, + githubClient GitHubClient, + organizationName, repoFullName, filePath string, + stream *models.StreamSender, +) (*models.Resource, error) { + sdk := resilientbridge.NewResilientBridge() sdk.SetDebug(false) - sdk.RegisterProvider("github", adapters.NewGitHubAdapter(githubClient.Token), &resilientbridge.ProviderConfig{ UseProviderLimits: true, MaxRetries: 3, BaseBackoff: time.Second, }) - // Fetch file content + // 1) Fetch the file content from GitHub contentEndpoint := fmt.Sprintf("/repos/%s/contents/%s", repoFullName, url.PathEscape(filePath)) contentReq := &resilientbridge.NormalizedRequest{ Method: "GET", Endpoint: contentEndpoint, Headers: map[string]string{"Accept": "application/vnd.github+json"}, } - contentResp, err := sdk.Request("github", contentReq) if err != nil { return nil, fmt.Errorf("error fetching content for %s/%s: %w", repoFullName, filePath, err) } - if contentResp.StatusCode >= 400 { - return nil, fmt.Errorf("HTTP error %d fetching content for %s/%s: %s", contentResp.StatusCode, repoFullName, filePath, string(contentResp.Data)) + return nil, fmt.Errorf("HTTP error %d fetching content for %s/%s: %s", + contentResp.StatusCode, repoFullName, filePath, string(contentResp.Data)) } var contentData model.ContentResponse @@ -262,23 +170,31 @@ func GetDockerfile(ctx context.Context, githubClient GitHubClient, organizationN return nil, fmt.Errorf("error parsing content response for %s/%s: %w", repoFullName, filePath, err) } - var fileContent string - if contentData.Encoding == "base64" { - decoded, err := base64.StdEncoding.DecodeString(contentData.Content) - if err != nil { - return nil, fmt.Errorf("error decoding base64 content for %s/%s: %w", repoFullName, filePath, err) - } - fileContent = string(decoded) - } else { - fileContent = contentData.Content + // 2) We rely on base64 content + dockerfileB64 := contentData.Content + if dockerfileB64 == "" { + return nil, fmt.Errorf("no base64 content found for %s/%s", repoFullName, filePath) } - lines := strings.Split(fileContent, "\n") - if len(lines) > 200 { - return nil, fmt.Errorf("skipping %s/%s: more than 200 lines (%d lines)", repoFullName, filePath, len(lines)) + // 3) Decode for line count + decoded, err := base64.StdEncoding.DecodeString(dockerfileB64) + if err != nil { + return nil, fmt.Errorf("error decoding base64 for %s/%s: %w", repoFullName, filePath, err) + } + lines := strings.Split(string(decoded), "\n") + if len(lines) > MAX_DOCKERFILE_LEN { + return nil, fmt.Errorf("skipping %s/%s: Dockerfile has %d lines (> %d)", + repoFullName, filePath, len(lines), MAX_DOCKERFILE_LEN) } - // Fetch last_updated_at via commits API + // 4) Parse via resilient-bridge/utils + images, parseErr := utils.ExtractExternalBaseImagesFromBase64(dockerfileB64) + if parseErr != nil { + log.Printf("Parsing error for Dockerfile at %s/%s: %v\n", repoFullName, filePath, parseErr) + images = []string{} + } + + // 5) Last updated date var lastUpdatedAt string commitsEndpoint := fmt.Sprintf("/repos/%s/commits?path=%s&per_page=1", repoFullName, url.QueryEscape(filePath)) commitReq := &resilientbridge.NormalizedRequest{ @@ -286,7 +202,6 @@ func GetDockerfile(ctx context.Context, githubClient GitHubClient, organizationN Endpoint: commitsEndpoint, Headers: map[string]string{"Accept": "application/vnd.github+json"}, } - commitResp, err := sdk.Request("github", commitReq) if err == nil && commitResp.StatusCode < 400 { var commits []model.CommitResponse @@ -311,9 +226,10 @@ func GetDockerfile(ctx context.Context, githubClient GitHubClient, organizationN GitURL: contentData.GitURL, HTMLURL: contentData.HTMLURL, URI: contentData.HTMLURL, - DockerfileContent: fileContent, - DockerfileContentBase64: contentData.Content, + DockerfileContent: string(decoded), + DockerfileContentBase64: dockerfileB64, Repository: repoObj, + Images: images, } value := models.Resource{ @@ -323,6 +239,5 @@ func GetDockerfile(ctx context.Context, githubClient GitHubClient, organizationN Value: output, }, } - return &value, nil } diff --git a/provider/model/model.go b/provider/model/model.go index c8e435dc..2375dbd6 100755 --- a/provider/model/model.go +++ b/provider/model/model.go @@ -101,43 +101,6 @@ type ArtifactsResponse struct { Artifacts []WorkflowArtifact `json:"artifacts"` } -//type WorkflowRunDescription struct { -// ID int64 -// Name string -// NodeID string -// HeadBranch string -// HeadSHA string -// RunNumber int -// RunAttempt int -// Event string -// DisplayTitle string -// Status string -// Conclusion string -// WorkflowID int64 -// CheckSuiteID int64 -// CheckSuiteNodeID string -// URL string -// HTMLURL string -// PullRequests []*github.PullRequest -// CreatedAt github.Timestamp -// UpdatedAt github.Timestamp -// RunStartedAt github.Timestamp -// JobsURL string -// LogsURL string -// CheckSuiteURL string -// ArtifactsURL string -// CancelURL string -// RerunURL string -// PreviousAttemptURL string -// HeadCommit *github.HeadCommit -// WorkflowURL string -// Repository *github.Repository -// HeadRepository *github.Repository -// Actor *github.User -// TriggeringActor *github.User -// RepoFullName string -//} - type AuditLogDescription struct { ID string CreatedAt github.Timestamp @@ -197,35 +160,6 @@ type BranchProtectionDescription struct { BypassPullRequestAllowanceUsers []BranchUser } -//type Parents []struct { -// SHA string `json:"sha"` -//} - -//type VerificationDetails struct { -// Reason string `json:"reason"` -// Signature *string `json:"signature"` -// VerifiedAt *string `json:"verified_at"` -//} - -//type AdditionalDetails struct { -// NodeID string `json:"node_id"` -// Parents Parents `json:"parents"` -// Tree Tree `json:"tree"` -// VerificationDetails VerificationDetails `json:"verification_details"` -//} - -//type UserMinimalInfo struct { -// Name string `json:"name"` -// Email string `json:"email"` -// Date string `json:"date"` -//} - -//type Changes struct { -// Additions int `json:"additions"` -// Deletions int `json:"deletions"` -// Total int `json:"total"` -//} - type Tree struct { SHA string `json:"sha"` URL string `json:"url"` @@ -316,21 +250,6 @@ type CommitDescription struct { Files []File `json:"files"` } -//type CommitDescription struct { -// AdditionalDetails AdditionalDetails `json:"additional_details"` -// Author Author `json:"author"` -// Changes Changes `json:"changes"` -// CommentCount int `json:"comment_count"` -// Date string `json:"date"` -// Files []File `json:"files"` -// HTMLURL string `json:"html_url"` -// ID string `json:"id"` -// IsVerified bool `json:"is_verified"` -// Message string `json:"message"` -// PullRequests []int `json:"pull_requests"` -// Target Target `json:"target"` -//} - type IssueDescription struct { RepositoryFullName string Id int @@ -723,118 +642,6 @@ type Metrics struct { Releases int `json:"releases"` } -//type RepositoryResponse struct { -// ID float64 `json:"id"` -// NodeID string `json:"node_id"` -// Name string `json:"name"` -// NameWithOwner string `json:"name_with_owner"` -// Description *string `json:"description"` -// Private bool `json:"private"` -// HTMLURL string `json:"html_url"` -// Fork bool `json:"fork"` -// URL string `json:"url"` -// CloneURL string `json:"clone_url"` -// GitURL string `json:"git_url"` -// SSHURL string `json:"ssh_url"` -// Homepage *string `json:"homepage"` -// Language string `json:"language"` -// ForksCount int `json:"forks_count"` -// StargazersCount int `json:"stargazers_count"` -// WatchersCount int `json:"watchers_count"` -// Size int `json:"size"` -// DefaultBranch string `json:"default_branch"` -// OpenIssuesCount int `json:"open_issues_count"` -// Topics []string `json:"topics"` -// HasIssues bool `json:"has_issues"` -// HasProjects bool `json:"has_projects"` -// HasWiki bool `json:"has_wiki"` -// HasPages bool `json:"has_pages"` -// HasDownloads bool `json:"has_downloads"` -// HasDiscussions bool `json:"has_discussions"` -// Archived bool `json:"archived"` -// Disabled bool `json:"disabled"` -// Visibility string `json:"visibility"` -// PushedAt string `json:"pushed_at"` -// CreatedAt string `json:"created_at"` -// UpdatedAt string `json:"updated_at"` -// AllowForking bool `json:"allow_forking"` -// WebCommitSignoffRequired bool `json:"web_commit_signoff_required"` -// ContentsURL string `json:"contents_url"` -// PullsURL string `json:"pulls_url"` -// CommitsURL string `json:"commits_url"` -// CompareURL string `json:"compare_url"` -// DownloadsURL string `json:"downloads_url"` -// ArchiveURL string `json:"archive_url"` -// AssigneesURL string `json:"assignees_url"` -// BlobsURL string `json:"blobs_url"` -// BranchesURL string `json:"branches_url"` -// CollaboratorsURL string `json:"collaborators_url"` -// CommentsURL string `json:"comments_url"` -// ContributorsURL string `json:"contributors_url"` -// DeploymentsURL string `json:"deployments_url"` -// EventsURL string `json:"events_url"` -// ForksURL string `json:"forks_url"` -// GitCommitsURL string `json:"git_commits_url"` -// GitRefsURL string `json:"git_refs_url"` -// GitTagsURL string `json:"git_tags_url"` -// HooksURL string `json:"hooks_url"` -// IssueCommentURL string `json:"issue_comment_url"` -// IssueEventsURL string `json:"issue_events_url"` -// IssuesURL string `json:"issues_url"` -// KeysURL string `json:"keys_url"` -// LabelsURL string `json:"labels_url"` -// LanguagesURL string `json:"languages_url"` -// MergesURL string `json:"merges_url"` -// MilestonesURL string `json:"milestones_url"` -// NotificationsURL string `json:"notifications_url"` -// ReleasesURL string `json:"releases_url"` -// StargazersURL string `json:"stargazers_url"` -// StatusesURL string `json:"statuses_url"` -// SubscribersURL string `json:"subscribers_url"` -// SubscriptionURL string `json:"subscription_url"` -// TagsURL string `json:"tags_url"` -// TeamsURL string `json:"teams_url"` -// TreesURL string `json:"trees_url"` -// Watchers int `json:"watchers"` -// IsTemplate bool `json:"is_template"` -// SecurityAndAnalysis map[string]map[string]string `json:"security_and_analysis"` -// Permissions map[string]bool `json:"permissions"` -// Owner RepoOwner `json:"owner"` -//} -// -//type RepoOwner struct { -// Login string `json:"login"` -// ID int64 `json:"id"` -// NodeID string `json:"node_id"` -// AvatarURL string `json:"avatar_url"` -// GravatarID string `json:"gravatar_id"` -// URL string `json:"url"` -// HTMLURL string `json:"html_url"` -// FollowersURL string `json:"followers_url"` -// FollowingURL string `json:"following_url"` -// GistsURL string `json:"gists_url"` -// StarredURL string `json:"starred_url"` -// SubscriptionsURL string `json:"subscriptions_url"` -// OrganizationsURL string `json:"organizations_url"` -// ReposURL string `json:"repos_url"` -// EventsURL string `json:"events_url"` -// ReceivedEventsURL string `json:"received_events_url"` -// Type string `json:"type"` -// SiteAdmin bool `json:"site_admin"` -//} -// -//type LicenseInfo struct { -// Key string `json:"key"` -// Name string `json:"name"` -// SPDXID string `json:"spdx_id"` -// URL string `json:"url"` -// NodeID string `json:"node_id"` -//} -// -//type DefaultBranchRef struct { -// Name string `json:"name"` -//} - type RepositoryDescription struct { GitHubRepoID int `json:"id"` NodeID string `json:"node_id"` @@ -1336,4 +1143,5 @@ type ArtifactDockerFileDescription struct { DockerfileContent string `json:"dockerfile_content"` DockerfileContentBase64 string `json:"dockerfile_content_base64"` Repository map[string]interface{} `json:"repository"` + Images []string `json:"images"` } diff --git a/steampipe-plugin-github/github/table_github_artifact_dockerfile.go b/steampipe-plugin-github/github/table_github_artifact_dockerfile.go index 022b4bf8..ff918979 100644 --- a/steampipe-plugin-github/github/table_github_artifact_dockerfile.go +++ b/steampipe-plugin-github/github/table_github_artifact_dockerfile.go @@ -69,6 +69,11 @@ func tableGitHubArtifactDockerFile() *plugin.Table { Type: proto.ColumnType_JSON, Transform: transform.FromField("Description.Repository"), Description: "Repository metadata associated with the Dockerfile."}, + { + Name: "images", + Type: proto.ColumnType_JSON, + Transform: transform.FromField("Description.Images"), + Description: ""}, }), } } diff --git a/steampipe-plugin-github/github/table_github_pull_request_comment.go b/steampipe-plugin-github/github/table_github_pull_request_comment.go index d4a9061c..f1e37e87 100644 --- a/steampipe-plugin-github/github/table_github_pull_request_comment.go +++ b/steampipe-plugin-github/github/table_github_pull_request_comment.go @@ -13,7 +13,6 @@ func tableGitHubPullRequestComment() *plugin.Table { Name: "github_pull_request_comment", Description: "Comments are the responses/comments on Pull Requests.", List: &plugin.ListConfig{ - KeyColumns: plugin.AllColumns([]string{"repository_full_name", "number"}), ShouldIgnoreError: isNotFoundError([]string{"404"}), Hydrate: tableGitHubRepositoryPullRequestCommentList, }, diff --git a/steampipe-plugin-github/github/table_github_pull_request_review.go b/steampipe-plugin-github/github/table_github_pull_request_review.go index 76f098f3..257fb9ae 100644 --- a/steampipe-plugin-github/github/table_github_pull_request_review.go +++ b/steampipe-plugin-github/github/table_github_pull_request_review.go @@ -32,7 +32,6 @@ func tableGitHubPullRequestReview() *plugin.Table { Name: "github_pull_request_review", Description: "Pull Request Reviews are groups of pull request review comments on a pull request.", List: &plugin.ListConfig{ - KeyColumns: plugin.AllColumns([]string{"repository_full_name", "number"}), ShouldIgnoreError: isNotFoundError([]string{"404"}), Hydrate: tableGitHubRepositoryPullRequestReviewList, },