Skip to content

Commit

Permalink
fix: Use name instead of slug in external-prs check (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryscheng authored May 21, 2024
1 parent 4d342a4 commit a205052
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ops/external-prs/src/ossd/queries/blockchain_artifacts.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE {{ source }}_blockchain_artifacts AS
SELECT DISTINCT
p.slug AS project_slug,
p.name AS project_slug,
LOWER(blockchains.blockchain.address) AS address,
tag.tags AS tag,
network.networks AS network
Expand Down
2 changes: 1 addition & 1 deletion ops/external-prs/src/ossd/queries/code_artifacts.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE {{ source }}_code_artifacts AS
SELECT
p.slug as project_slug,
p.name as project_slug,
gh.github.url as code_url,
'GITHUB' as code_host
FROM {{ source }}_projects as p
Expand Down
2 changes: 1 addition & 1 deletion ops/external-prs/src/ossd/queries/package_artifacts.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE {{ source }}_package_artifacts AS
SELECT
p.slug as project_slug,
p.name as project_slug,
npm.npm.url as package_url,
'NPM' as package_host
FROM {{ source }}_projects as p
Expand Down
10 changes: 5 additions & 5 deletions ops/external-prs/src/ossd/queries/project_status.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
CREATE TABLE project_status AS
SELECT
CASE
WHEN main.slug IS NOT NULL THEN main.slug
ELSE pr.slug
WHEN main.name IS NOT NULL THEN main.name
ELSE pr.name
END AS project_slug,
CASE
WHEN main.slug IS NOT NULL AND pr.slug IS NOT NULL THEN
WHEN main.name IS NOT NULL AND pr.name IS NOT NULL THEN
CASE
WHEN main.name != pr.name THEN 'UPDATED'
ELSE 'EXISTING'
END
WHEN main.slug IS NOT NULL AND pr.slug IS NULL THEN 'REMOVED'
WHEN main.name IS NOT NULL AND pr.name IS NULL THEN 'REMOVED'
ELSE 'ADDED'
END AS status
FROM main_projects AS main
FULL OUTER JOIN pr_projects AS pr
ON main.slug = pr.slug
ON main.name = pr.name
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE {{ source }}_projects_by_collection AS
SELECT
c.slug AS collection_slug,
c.name AS collection_slug,
p.* AS project_slug
FROM {{ source }}_collections AS c
CROSS JOIN UNNEST(c.projects) AS p

0 comments on commit a205052

Please sign in to comment.