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

Comments

@julieqiu
Copy link
Contributor

@julieqiu 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).

@namaggarwal
Copy link

@namaggarwal namaggarwal commented Jul 4, 2020

Hello @julieqiu, Can I pick this up ?

@julieqiu
Copy link
Contributor Author

@julieqiu 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

@gopherbot gopherbot commented Jul 5, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants