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

Version filtering #1050

Merged
merged 3 commits into from
Feb 5, 2019
Merged

Version filtering #1050

merged 3 commits into from
Feb 5, 2019

Conversation

Kunde21
Copy link
Contributor

@Kunde21 Kunde21 commented Feb 3, 2019

What is the problem I am trying to address?

Increase the granularity of module filtering to include version matching.

How is the fix applied?

A comma-separated list of version filters is parsed from the filter rule, separated from the module by a space. These version filters are applied using a prefix match, similar to the module filtering.

Documentation has been updated, with an example filter file using version filtering.

Mention the issue number it fixes or add the details of the changes if it doesn't have a specific issue.

Fixes #1045

@Kunde21 Kunde21 requested a review from a team as a code owner February 3, 2019 03:36
Module filtering is very useful, but many deployments will need to
satisfy even more granular constrainsts.  Enterprises may need
approved lists specific down to the minor (or patch) version element.

Version filtering logic is similar to the module filtering, in that
it's a prefix match of the version requested against each entry in the
version filter list.

Closes gomods#1045
@Kunde21 Kunde21 force-pushed the 1045-version_filter branch from b370c33 to 7d6e746 Compare February 3, 2019 04:34
Endpoints that do not specify a version, such as "@v/list", only need
to be filtered by module rules.
@codecov-io
Copy link

Codecov Report

Merging #1050 into master will increase coverage by 0.38%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1050      +/-   ##
==========================================
+ Coverage   52.96%   53.34%   +0.38%     
==========================================
  Files          79       79              
  Lines        2562     2583      +21     
==========================================
+ Hits         1357     1378      +21     
  Misses       1092     1092              
  Partials      113      113
Impacted Files Coverage Δ
pkg/middleware/filter.go 81.81% <100%> (+2.5%) ⬆️
pkg/module/filter.go 93.61% <92%> (+0.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update adb4dbb...e01f4c2. Read the comment docs.

Copy link
Member

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@manugupt1 manugupt1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is awesome!!

@michalpristas michalpristas merged commit 7811524 into gomods:master Feb 5, 2019
@Kunde21 Kunde21 deleted the 1045-version_filter branch February 5, 2019 08:06
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

Successfully merging this pull request may close these issues.

Filter module version
4 participants