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

x/pkgsite: create GetModuleInfo function #40032

Closed
julieqiu opened this issue Jul 4, 2020 · 3 comments
Closed

x/pkgsite: create GetModuleInfo function #40032

julieqiu opened this issue Jul 4, 2020 · 3 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. pkgsite Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@julieqiu
Copy link
Member

julieqiu commented Jul 4, 2020

As part of the new data model migration (#39629), we will need a function return the ModuleInfo for a given module_path and version.

This function will eventually replace the existing LegacyGetModuleInfo function.

The function signature will be:

GetModuleInfo(ctx context.Context, modulePath string, resolvedVersion string) (_ *internal.ModuleInfo, err error)

The function will execute the query below:

SELECT
    module_path,
    version,
    commit_time,
    version_type,
    source_info,
    redistributable,
    has_go_mod
FROM
    modules
WHERE
    module_path=$1
    AND version=$2;

Unlike LegacyGetModuleInfo, it is expected that the version passed into the function will always be a semantic version (i.e. GetModuleInfo will NOT need to handle the case where resolvedVersion == internal.LatestVersion).

@julieqiu julieqiu added Suggested Issues that may be good for new contributors looking for work to do. help wanted NeedsFix The path to resolution is known, but the work has not been done. pkgsite labels Jul 4, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jul 4, 2020
@namaggarwal
Copy link

Hello @julieqiu, Can I pick this up ?

@julieqiu
Copy link
Member Author

julieqiu commented Jul 4, 2020

Yes, please do!

namaggarwal added a commit to namaggarwal/pkgsite that referenced this issue Jul 5, 2020
GetModuleInfo returns the ModuleInfo for given module_path and version.
This will replace LegacyGetModuleInfo.

Fixes golang/go#40032
@gopherbot
Copy link

Change https://golang.org/cl/241038 mentions this issue: internal/postgres: add GetModuleInfo function

@golang golang locked and limited conversation to collaborators Jul 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. pkgsite Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants