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

Switch /:name/specs/latest to use GH API? #446

Open
orta opened this issue May 24, 2023 · 0 comments
Open

Switch /:name/specs/latest to use GH API? #446

orta opened this issue May 24, 2023 · 0 comments

Comments

@orta
Copy link
Member

orta commented May 24, 2023

Right now there's a pretty chunky query going on:

commits = DB[<<-SQL, params[:name]].all
          SELECT DISTINCT ON (pod_versions.id)
              pods.name          "name",
              pod_versions.name  "version",
              commits.sha        "sha",
              commits.created_at "created_at"
          FROM
              pods
          LEFT JOIN
              pod_versions ON pods.id = pod_versions.pod_id
          INNER JOIN
              commits      ON pod_versions.id = commits.pod_version_id
          WHERE
              pods.name = ? AND pods.deleted is false AND pod_versions.deleted is false
          ORDER BY
              pod_versions.id
        SQL

Could this be replaced by the GH API?

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

No branches or pull requests

1 participant