From 5eb2d5264e94b3710558d85a603aa2a9b820be4a Mon Sep 17 00:00:00 2001 From: Sean Goggins Date: Mon, 20 Jun 2022 14:05:32 -0500 Subject: [PATCH 1/4] OSSF Scorecard updating process. --- scripts/install/workers.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install/workers.sh b/scripts/install/workers.sh index bc57eec33f..3288ce3b92 100755 --- a/scripts/install/workers.sh +++ b/scripts/install/workers.sh @@ -49,6 +49,13 @@ go mod download github.com/maxbrunsfeld/counterfeiter/v6@v6.5.0 if [ -d "$HOME/scorecard" ]; then echo " Scorecard already exists, skipping cloning ..." + echo " Updating Scorecard ... " + CURRENT_DIR=$PWD; + cd $HOME/scorecard; + git pull; + go build; + echo "Scorecard build done." + cd $CURRENT_DIR else echo "Cloning OSSF Scorecard to generate scorecard data ..." git clone https://github.com/ossf/scorecard $HOME/scorecard From 4c2da3aed1c63882e2921e5fb14b84df0617bd74 Mon Sep 17 00:00:00 2001 From: "Sean P. Goggins" Date: Tue, 28 Jun 2022 10:26:46 -0500 Subject: [PATCH 2/4] updated schema update --- schema/generate/103-schema_update_105.sql | 60 +++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 schema/generate/103-schema_update_105.sql diff --git a/schema/generate/103-schema_update_105.sql b/schema/generate/103-schema_update_105.sql new file mode 100644 index 0000000000..72872be0f5 --- /dev/null +++ b/schema/generate/103-schema_update_105.sql @@ -0,0 +1,60 @@ +BEGIN; +CREATE SEQUENCE "augur_operations"."chaoss_user_repos_user_repo_id_seq" +INCREMENT 1 +MINVALUE 1 +MAXVALUE 9223372036854775807 +START 1 +CACHE 1; + +CREATE TABLE "augur_operations"."chaoss_user" ( + "chaoss_id" int8 NOT NULL DEFAULT nextval('augur_data.chaoss_user_chaoss_id_seq'::regclass), + "chaoss_login_name" varchar COLLATE "pg_catalog"."default", + "chaoss_login_hashword" varchar COLLATE "pg_catalog"."default", + "chaoss_email" varchar COLLATE "pg_catalog"."default", + "chaoss_text_phone" varchar COLLATE "pg_catalog"."default", + "chaoss_first_name" varchar COLLATE "pg_catalog"."default", + "chaoss_last_name" varchar COLLATE "pg_catalog"."default", + "tool_source" varchar COLLATE "pg_catalog"."default", + "tool_version" varchar COLLATE "pg_catalog"."default", + "data_source" varchar COLLATE "pg_catalog"."default", + "data_collection_date" timestamptz(6) DEFAULT now(), + CONSTRAINT "chaoss_user_pkey" PRIMARY KEY ("chaoss_id"), + CONSTRAINT "chaoss_unique_email_key" UNIQUE ("chaoss_email") +) +; + +ALTER TABLE "augur_operations"."chaoss_user" OWNER TO "augur"; + +CREATE TABLE "augur_operations"."chaoss_user_repos" ( + "user_repo_id" int8 NOT NULL DEFAULT nextval('"augur_operations".chaoss_user_repos_user_repo_id_seq'::regclass), + "chaoss_user_id" int8, + "augur_rg_id" int8, + "augur_repo_id" int8, + "tool_source" varchar COLLATE "pg_catalog"."default", + "tool_version" varchar COLLATE "pg_catalog"."default", + "data_source" varchar COLLATE "pg_catalog"."default", + "data_collection_date" timestamptz(6), + CONSTRAINT "chaoss_user_repos_pkey" PRIMARY KEY ("user_repo_id") +) +; + +ALTER TABLE "augur_operations"."chaoss_user_repos" OWNER TO "augur"; + +COMMENT ON COLUMN "augur_operations"."chaoss_user_repos"."chaoss_user_id" IS 'maps to chaoss_id in chaoss_user table in augur_operations. '; + +COMMENT ON COLUMN "augur_operations"."chaoss_user_repos"."augur_rg_id" IS 'Maps to repo_group_id in repo_groups table in augur_data. '; + +COMMENT ON COLUMN "augur_operations"."chaoss_user_repos"."augur_repo_id" IS 'Maps to repo_id in repos table in augur_data'; + +SELECT setval('"augur_operations"."chaoss_user_repos_user_repo_id_seq"', 1, false); + +ALTER SEQUENCE "augur_operations"."chaoss_user_repos_user_repo_id_seq" +OWNED BY "augur_operations"."chaoss_user_repos"."user_repo_id"; + +ALTER SEQUENCE "augur_operations"."chaoss_user_repos_user_repo_id_seq" OWNER TO "augur"; + +grant all privileges on table augur_operations.chaoss_user to mlgsoc; +grant all privileges on table augur_operations.chaoss_user_repos to mlgsoc; + + +COMMIT; \ No newline at end of file From 013d76b8d392878af143afd990fa4fddf35477aa Mon Sep 17 00:00:00 2001 From: Sean Goggins Date: Tue, 5 Jul 2022 10:44:47 -0500 Subject: [PATCH 3/4] Dependency Materialized Views and CHAOSS User Login Tables --- schema/create_schema.sql | 2 + schema/generate/103-schema_update_105.sql | 2 + schema/generate/104-schema_update_106.sql | 65 +++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 schema/generate/104-schema_update_106.sql diff --git a/schema/create_schema.sql b/schema/create_schema.sql index 9054bdb659..1063106e71 100644 --- a/schema/create_schema.sql +++ b/schema/create_schema.sql @@ -27,6 +27,8 @@ \i schema/generate/100-schema_update_102.sql \i schema/generate/101-schema_update_103.sql \i schema/generate/102-schema_update_104.sql +\i schema/generate/103-schema_update_105.sql +\i schema/generate/104-schema_update_106.sql -- prior update scripts incorporated into diff --git a/schema/generate/103-schema_update_105.sql b/schema/generate/103-schema_update_105.sql index 72872be0f5..528ec5077f 100644 --- a/schema/generate/103-schema_update_105.sql +++ b/schema/generate/103-schema_update_105.sql @@ -56,5 +56,7 @@ ALTER SEQUENCE "augur_operations"."chaoss_user_repos_user_repo_id_seq" OWNER TO grant all privileges on table augur_operations.chaoss_user to mlgsoc; grant all privileges on table augur_operations.chaoss_user_repos to mlgsoc; +update "augur_operations"."augur_settings" set value = 105 + where setting = 'augur_data_version'; COMMIT; \ No newline at end of file diff --git a/schema/generate/104-schema_update_106.sql b/schema/generate/104-schema_update_106.sql new file mode 100644 index 0000000000..550665b353 --- /dev/null +++ b/schema/generate/104-schema_update_106.sql @@ -0,0 +1,65 @@ +BEGIN; +CREATE MATERIALIZED VIEW "augur_data"."explorer_libyear_all" +AS +SELECT + a.repo_id, + a.repo_name, + AVG ( libyear ) AS avg_libyear, + date_part( 'month' :: TEXT, ( A.data_collection_date ) :: DATE ) AS MONTH, + date_part( 'year' :: TEXT, ( A.data_collection_date ) :: DATE ) AS YEAR +FROM + repo a, + repo_deps_libyear b +GROUP BY + a.repo_id, + a.repo_name, + month, + year +ORDER BY + year desc, + month desc, + avg_libyear desc; + + +grant all privileges on table "augur_data"."explorer_libyear_all" to cali; +grant all privileges on table "augur_data"."explorer_libyear_all" to cali; + + +CREATE MATERIALIZED VIEW "augur_data"."explorer_libyear_detail" +AS +SELECT + a.repo_id, + a.repo_name, + b.name, + b.requirement, + b.current_verion, + b.latest_version, + b.current_release_date, + b.current_release_date, + libyear, + max(b.data_collection_date) +FROM + repo a, + repo_deps_libyear b +GROUP BY + a.repo_id, + a.repo_name, + b.name, + b.requirement, + b.current_verion, + b.latest_version, + b.current_release_date, + b.current_release_date, + libyear +ORDER BY + a.repo_id, + b.requirement; + +grant all privileges on table "augur_data"."explorer_libyear_detail" to cali; +grant all privileges on table "augur_data"."explorer_libyear_detail" to cali; + + +update "augur_operations"."augur_settings" set value = 106 + where setting = 'augur_data_version'; + +COMMIT; \ No newline at end of file From f1503ee6e72fd4093a6922ef09858ef66e1e5b32 Mon Sep 17 00:00:00 2001 From: Sean Goggins Date: Tue, 5 Jul 2022 10:46:54 -0500 Subject: [PATCH 4/4] Fixed double column bug. --- schema/generate/104-schema_update_106.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/schema/generate/104-schema_update_106.sql b/schema/generate/104-schema_update_106.sql index 550665b353..24088d92cc 100644 --- a/schema/generate/104-schema_update_106.sql +++ b/schema/generate/104-schema_update_106.sql @@ -35,7 +35,6 @@ SELECT b.current_verion, b.latest_version, b.current_release_date, - b.current_release_date, libyear, max(b.data_collection_date) FROM @@ -49,7 +48,6 @@ GROUP BY b.current_verion, b.latest_version, b.current_release_date, - b.current_release_date, libyear ORDER BY a.repo_id,