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

HMS-4932: Add search module streams #897

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

Andrewgdewar
Copy link
Member

@Andrewgdewar Andrewgdewar commented Nov 18, 2024

Summary

Adds the POST "snapshots/module_streams/search" endpoint.
That takes the following inputs

{
  "uuids": [
    "9d164ac6-b866-4808-af1f-847fbf588658",
    "36e449b9-3d61-43e8-a495-6ac332fdd3a8"
  ],
  "rpm_names": [],
  "search": ""
}

and returns a list of modules with their streams:

{
 [
  {
    "module_name": "mariadb",
    "streams": [
      {
        "name": "mariadb",
        "stream": "10.11",
        "context": "rhel9",
        "arch": "x86_64",
        "cersion": "9040020240126110506",
        "description": "MariaDB is a....",
        "profiles": {
          "client": [
            "mariadb"
          ],
          "galera": [
            "mariadb-server",
            "mariadb-server-galera"
          ],
          "server": [
            "mariadb-server"
          ]
        }
      }
    ]
  },
]

}

Testing steps

@jlsherrill
Copy link
Member

@rverdile rverdile self-assigned this Nov 20, 2024
@jlsherrill jlsherrill changed the title Fixes 4932: Add search module streams Fixes HMS-4932: Add search module streams Nov 27, 2024
@jlsherrill
Copy link
Member

jlsherrill commented Nov 27, 2024

https://issues.redhat.com/browse/HMS-4932

EDIT: remove duplicated HMS

@Andrewgdewar Andrewgdewar force-pushed the HMS-4932 branch 3 times, most recently from 76493c7 to 852c0f8 Compare November 29, 2024 00:35
@Andrewgdewar Andrewgdewar marked this pull request as ready for review November 29, 2024 00:36
@swadeley
Copy link
Member

swadeley commented Dec 2, 2024

/retest

@jlsherrill
Copy link
Member

pkg/api/rpms.go Outdated Show resolved Hide resolved
pkg/handler/rpms.go Outdated Show resolved Hide resolved
pkg/api/rpms.go Outdated Show resolved Hide resolved
@swadeley
Copy link
Member

swadeley commented Dec 3, 2024

Warning: Unexpected input(s) 'skip-go-installation',

@Andrewgdewar
Copy link
Member Author

Warning: Unexpected input(s) 'skip-go-installation',

This requires the tangy PR to be integrated, don't test this yet.

@Andrewgdewar Andrewgdewar force-pushed the HMS-4932 branch 2 times, most recently from f94d7c7 to 94715d6 Compare December 3, 2024 21:03
@jlsherrill jlsherrill changed the title Fixes HMS-4932: Add search module streams Fixes 4932: Add search module streams Dec 4, 2024
pkg/api/module_streams.go Outdated Show resolved Hide resolved
pkg/api/module_streams.go Outdated Show resolved Hide resolved
@jlsherrill
Copy link
Member

seems to be some linting issue

@swadeley
Copy link
Member

/retest

@swadeley
Copy link
Member

Warning: Unexpected input(s) 'skip-go-installation',

This requires the tangy PR to be integrated, don't test this yet.

OK but winter is coming :)

02:31:28 pkg/dao/module_streams.go:65:37: (*config.Tang).RpmRepositoryVersionModuleStreamsList undefined (type tangy.Tangy has no field or method RpmRepositoryVersionModuleStreamsList)

@Andrewgdewar
Copy link
Member Author

seems to be some linting issue

tangy..

@jlsherrill
Copy link
Member

few small comment, but overall looks good

@jlsherrill jlsherrill changed the title Fixes 4932: Add search module streams HMS-4932: Add search module streams Dec 18, 2024
@jlsherrill
Copy link
Member

lets merge content-services/tang#14 and tag a new tang version, then pull that update in here?

@Andrewgdewar Andrewgdewar force-pushed the HMS-4932 branch 2 times, most recently from 67e22a1 to fe321db Compare December 20, 2024 19:05
@jlsherrill
Copy link
Member

note this require iqe update to merge

@swadeley
Copy link
Member

swadeley commented Jan 2, 2025

@Andrewgdewar please rebase

@swadeley
Copy link
Member

swadeley commented Jan 2, 2025

/retest

@swadeley
Copy link
Member

swadeley commented Jan 3, 2025

Hi

I built the API docs for IQE but its taking forever to get a suitable RHEL repo in ephemeral snapshotted. Will test in stage.

Format for IQE:

In [9]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search='mariadb', uuids=['776a0172-5855-4734-b382-8e4d60a44a84'], rpm_names=[]))

@swadeley
Copy link
Member

swadeley commented Jan 3, 2025

Hi

testing with: https://rverdile.fedorapeople.org/dummy-repos/modules/repo1/

In [9]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search='', uuids=['6d1da6ea-6603-4cb9-bec4-f803dcaee830'], rpm_names=['kangaroo']))
2025-01-03 15:29:40.761 [    INFO] [iqe.base.rest_client] REST: POST https://ee-bt0c0eqb.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[9]: 
[{'module_name': 'kangaroo',
  'streams': [{'arch': 'noarch',
               'context': 'deadbeef',
               'description': 'A module for the kangaroo 0.2 package',
               'name': 'kangaroo',
               'profiles': {'default': ['kangaroo']},
               'stream': '0',
               'version': '20180704111719'}]}]

but nothing if blank search:

In [12]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search="", uuids=['6d1da6ea-6603-4cb9-bec4-f803dcaee830'], rpm_names=[""]))
2025-01-03 15:33:05.554 [    INFO] [iqe.base.rest_client] REST: POST https://ee-bt0c0eqb.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[12]: []

@Andrewgdewar
Copy link
Member Author

Hi

testing with: https://rverdile.fedorapeople.org/dummy-repos/modules/repo1/

In [9]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search='', uuids=['6d1da6ea-6603-4cb9-bec4-f803dcaee830'], rpm_names=['kangaroo']))
2025-01-03 15:29:40.761 [    INFO] [iqe.base.rest_client] REST: POST https://ee-bt0c0eqb.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[9]: 
[{'module_name': 'kangaroo',
  'streams': [{'arch': 'noarch',
               'context': 'deadbeef',
               'description': 'A module for the kangaroo 0.2 package',
               'name': 'kangaroo',
               'profiles': {'default': ['kangaroo']},
               'stream': '0',
               'version': '20180704111719'}]}]

but nothing if blank search:

In [12]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search="", uuids=['6d1da6ea-6603-4cb9-bec4-f803dcaee830'], rpm_names=[""]))
2025-01-03 15:33:05.554 [    INFO] [iqe.base.rest_client] REST: POST https://ee-bt0c0eqb.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[12]: []

This is expected. You need to give the api at least one uuid.

@swadeley
Copy link
Member

swadeley commented Jan 7, 2025

Hi
testing with: https://rverdile.fedorapeople.org/dummy-repos/modules/repo1/

In [9]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search='', uuids=['6d1da6ea-6603-4cb9-bec4-f803dcaee830'], rpm_names=['kangaroo']))
2025-01-03 15:29:40.761 [    INFO] [iqe.base.rest_client] REST: POST https://ee-bt0c0eqb.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[9]: 
[{'module_name': 'kangaroo',
  'streams': [{'arch': 'noarch',
               'context': 'deadbeef',
               'description': 'A module for the kangaroo 0.2 package',
               'name': 'kangaroo',
               'profiles': {'default': ['kangaroo']},
               'stream': '0',
               'version': '20180704111719'}]}]

but nothing if blank search:

In [12]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search="", uuids=['6d1da6ea-6603-4cb9-bec4-f803dcaee830'], rpm_names=[""]))
2025-01-03 15:33:05.554 [    INFO] [iqe.base.rest_client] REST: POST https://ee-bt0c0eqb.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[12]: []

This is expected. You need to give the api at least one uuid.

OK, thank you

@swadeley swadeley merged commit f3dc32a into content-services:main Jan 7, 2025
11 of 12 checks passed
@swadeley
Copy link
Member

forgot to add this better example output:

In [7]: app.content_sources.rest_client.module_streams_api.search_snapshot_module_streams(dict(search='walrus', uuids=['177e9b6f-0125-4628-9953-40195e368822'], rpm_names=[]))
2025-01-16 11:52:41.209 [    INFO] [iqe.base.rest_client] REST: POST https://ee-fryb0ek4.apps.crc-eph.r9lp.p1.openshiftapps.com/api/content-sources/v1/snapshots/module_streams/search with query params [] and x-rh-insights-request-id=<>
Out[7]: 
[{'module_name': 'walrus',
  'streams': [{'arch': 'x86_64',
               'context': 'c0ffee42',
               'description': 'A module for the walrus 0.71 package',
               'name': 'walrus',
               'profiles': {'default': ['walrus'], 'flipper': ['walrus']},
               'stream': '0.71',
               'version': '20180707144203'},
              {'arch': 'x86_64',
               'context': 'deadbeef',
               'description': 'A module for the walrus 5.21 package',
               'name': 'walrus',
               'profiles': {'default': ['walrus']},
               'stream': '5.21',
               'version': '20180704144203'}]}]

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

Successfully merging this pull request may close these issues.

4 participants