Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: release-engineering/iib
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fcc9b6eb7436377680eb937dc2b05f6dddf62af6
Choose a base ref
...
head repository: release-engineering/iib
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c57f6ed890803210502277dbb14e5b2c7e9ba03d
Choose a head ref
  • 7 commits
  • 4 files changed
  • 2 contributors

Commits on Feb 25, 2025

  1. Update dependency botocore to v1.37.0

    renovate[bot] authored and JAVGan committed Feb 25, 2025
    Copy the full SHA
    7897928 View commit details
  2. Update dependency boto3 to v1.37.0

    renovate[bot] authored and JAVGan committed Feb 25, 2025
    Copy the full SHA
    eed868a View commit details
  3. Update dependency setuptools to v75.8.1

    renovate[bot] authored and JAVGan committed Feb 25, 2025
    Copy the full SHA
    5572ee2 View commit details

Commits on Feb 26, 2025

  1. Update dependency botocore to v1.37.1

    renovate[bot] authored and JAVGan committed Feb 26, 2025
    Copy the full SHA
    99d6913 View commit details
  2. Update dependency boto3 to v1.37.1

    renovate[bot] authored and JAVGan committed Feb 26, 2025
    Copy the full SHA
    438b2ca View commit details

Commits on Mar 3, 2025

  1. CLOUDDST-24254 : Merge index image failing with FBC operator present …

    …in source
    
    This commit fix this bug by ignoring deprecation operators which are not available in database.
    Ashwini Kumar committed Mar 3, 2025
    Copy the full SHA
    8aae602 View commit details
  2. updating it to use pre-existing verify_operators_exists

    Ashwini Kumar committed Mar 3, 2025
    Copy the full SHA
    c57f6ed View commit details
Showing with 59 additions and 23 deletions.
  1. +24 −4 iib/workers/tasks/build_merge_index_image.py
  2. +9 −9 requirements-test.txt
  3. +6 −6 requirements.txt
  4. +20 −4 tests/test_workers/test_tasks/test_build_merge_index_image.py
28 changes: 24 additions & 4 deletions iib/workers/tasks/build_merge_index_image.py
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
deprecate_bundles_fbc,
opm_index_add,
deprecate_bundles,
verify_operators_exists,
Opm,
)
from packaging.version import Version
@@ -316,21 +317,40 @@ def handle_merge_request(
set_request_state(request_id, 'in_progress', 'Deprecating bundles in the deprecation list')
log.info('Deprecating bundles in the deprecation list')
intermediate_bundles = missing_bundle_paths + source_index_bundles_pull_spec

deprecation_bundles = get_bundles_from_deprecation_list(
intermediate_bundles, deprecation_list
)

# We do not need to pass the invalid_version_bundles through the
# get_bundles_from_deprecation_list function because we already know
# they are present in the newly created index.

invalid_version_bundles_names = [
bundle["packageName"] for bundle in invalid_version_bundles
]

intermediate_image_name = _get_external_arch_pull_spec(
request_id, arch, include_transport=False
)
filtered_invalid_version_bundles_names, _ = verify_operators_exists(
from_index=intermediate_image_name,
base_dir=temp_dir,
operator_packages=invalid_version_bundles_names,
overwrite_from_index_token=None,
)

# Operator passed in deprecation list should be available in operator database,
invalid_version_bundles = [
bundle
for bundle in invalid_version_bundles
if bundle["packageName"] in list(filtered_invalid_version_bundles_names)
]
deprecation_bundles = deprecation_bundles + [
bundle['bundlePath'] for bundle in invalid_version_bundles
]

if deprecation_bundles:
intermediate_image_name = _get_external_arch_pull_spec(
request_id, arch, include_transport=False
)

# we can check if source index is FBC or not because intermediate_image
# will be always the same type because it is built
# from source index image in _add_bundles_missing_in_source()
18 changes: 9 additions & 9 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -28,13 +28,13 @@ blinker==1.9.0 \
# via
# -r requirements.txt
# flask
boto3==1.36.26 \
--hash=sha256:523b69457eee55ac15aa707c0e768b2a45ca1521f95b2442931090633ec72458 \
--hash=sha256:f67d014a7c5a3cd540606d64d7cb9eec3600cf42acab1ac0518df9751ae115e2
boto3==1.37.1 \
--hash=sha256:4320441f904435a1b85e6ecb81793192e522c737cc9ed6566014e29f0a11cb22 \
--hash=sha256:96d18f7feb0c1fcb95f8837b74b6c8880e1b4e35ce5f8a8f8cb243a090c278ed
# via -r requirements.txt
botocore==1.36.26 \
--hash=sha256:4a63bcef7ecf6146fd3a61dc4f9b33b7473b49bdaf1770e9aaca6eee0c9eab62 \
--hash=sha256:4e3f19913887a58502e71ef8d696fe7eaa54de7813ff73390cd5883f837dfa6e
botocore==1.37.1 \
--hash=sha256:b194db8fb2a0ffba53568c364ae26166e7eec0445496b2ac86a6e142f3dd982f \
--hash=sha256:c1db1bfc5d8c6b3b6d1ca6794f605294b4264e82a7e727b88e0fef9c2b9fbb9c
# via
# -r requirements.txt
# boto3
@@ -1260,9 +1260,9 @@ zipp==3.21.0 \
# importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==75.8.0 \
--hash=sha256:c5afc8f407c626b8313a86e10311dd3f661c6cd9c09d4bf8c15c0e11f9f2b0e6 \
--hash=sha256:e3982f444617239225d675215d51f6ba05f845d4eec313da4418fdbb56fb27e3
setuptools==75.8.1 \
--hash=sha256:3bc32c0b84c643299ca94e77f834730f126efd621de0cc1de64119e0e17dab1f \
--hash=sha256:65fb779a8f28895242923582eadca2337285f0891c2c9e160754df917c3d2530
# via
# -r requirements-test.in
# pbr
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@ blinker==1.9.0 \
--hash=sha256:b4ce2265a7abece45e7cc896e98dbebe6cead56bcf805a3d23136d145f5445bf \
--hash=sha256:ba0efaa9080b619ff2f3459d1d500c57bddea4a6b424b60a91141db6fd2f08bc
# via flask
boto3==1.36.26 \
--hash=sha256:523b69457eee55ac15aa707c0e768b2a45ca1521f95b2442931090633ec72458 \
--hash=sha256:f67d014a7c5a3cd540606d64d7cb9eec3600cf42acab1ac0518df9751ae115e2
boto3==1.37.1 \
--hash=sha256:4320441f904435a1b85e6ecb81793192e522c737cc9ed6566014e29f0a11cb22 \
--hash=sha256:96d18f7feb0c1fcb95f8837b74b6c8880e1b4e35ce5f8a8f8cb243a090c278ed
# via iib (setup.py)
botocore==1.36.26 \
--hash=sha256:4a63bcef7ecf6146fd3a61dc4f9b33b7473b49bdaf1770e9aaca6eee0c9eab62 \
--hash=sha256:4e3f19913887a58502e71ef8d696fe7eaa54de7813ff73390cd5883f837dfa6e
botocore==1.37.1 \
--hash=sha256:b194db8fb2a0ffba53568c364ae26166e7eec0445496b2ac86a6e142f3dd982f \
--hash=sha256:c1db1bfc5d8c6b3b6d1ca6794f605294b4264e82a7e727b88e0fef9c2b9fbb9c
# via
# boto3
# s3transfer
24 changes: 20 additions & 4 deletions tests/test_workers/test_tasks/test_build_merge_index_image.py
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
@mock.patch('iib.workers.tasks.build_merge_index_image._push_image')
@mock.patch('iib.workers.tasks.build_merge_index_image._build_image')
@mock.patch('iib.workers.tasks.build_merge_index_image.deprecate_bundles_fbc')
@mock.patch('iib.workers.tasks.build_merge_index_image.verify_operators_exists')
@mock.patch('iib.workers.tasks.build_merge_index_image.deprecate_bundles')
@mock.patch('iib.workers.tasks.build_merge_index_image._get_external_arch_pull_spec')
@mock.patch('iib.workers.tasks.build_merge_index_image.get_bundles_from_deprecation_list')
@@ -63,6 +64,7 @@ def test_handle_merge_request(
mock_gbfdl,
mock_geaps,
mock_dep_b,
mock_verify_operator_exits,
mock_dep_b_fbc,
mock_bi,
mock_pi,
@@ -118,6 +120,7 @@ def side_effect(*args, base_dir, **kwargs):

mock_dep_b.side_effect = side_effect
mock_dep_b_fbc.side_effect = side_effect
mock_verify_operator_exits.return_value = (mock_dep_b, "")

mock_gidp.return_value = '/tmp'
mock_run_cmd.return_value = json.dumps(
@@ -182,7 +185,9 @@ def side_effect(*args, base_dir, **kwargs):


@pytest.mark.parametrize('source_fbc, target_fbc', [(False, False), (False, True), (True, True)])
@pytest.mark.parametrize('invalid_bundles', ([], [{'bundlePath': 'invalid_bundle:1.0'}]))
@pytest.mark.parametrize(
'invalid_bundles', ([], [{'bundlePath': 'invalid_bundle:1.0', "packageName": "invalid_bundle"}])
)
@mock.patch('iib.workers.tasks.opm_operations._get_input_data_path')
@mock.patch('iib.workers.tasks.utils.run_cmd')
@mock.patch('iib.workers.tasks.build_merge_index_image._update_index_image_pull_spec')
@@ -203,21 +208,25 @@ def side_effect(*args, base_dir, **kwargs):
return_value=[[{'bundlePath': 'some_bundle'}], []],
)
@mock.patch('iib.workers.tasks.utils.set_request_state')
@mock.patch('iib.workers.tasks.opm_operations.get_list_bundles')
@mock.patch('iib.workers.tasks.build_merge_index_image.set_request_state')
@mock.patch('iib.workers.tasks.build_merge_index_image._update_index_image_build_state')
@mock.patch('iib.workers.tasks.build_merge_index_image.prepare_request_for_build')
@mock.patch('iib.workers.tasks.build_merge_index_image._cleanup')
@mock.patch('iib.workers.tasks.build_merge_index_image._add_label_to_index')
@mock.patch('iib.workers.tasks.build_merge_index_image.is_image_fbc')
@mock.patch('iib.workers.tasks.opm_operations.Opm.set_opm_version')
@mock.patch('iib.workers.tasks.opm_operations.get_hidden_index_database')
def test_handle_merge_request_no_deprecate(
mock_get_hidden_db,
mock_sov,
mock_iifbc,
mock_add_label_to_index,
mock_cleanup,
mock_prfb,
mock_uiibs,
mock_srs,
mock_get_bundles,
mock_srs2,
mock_gpb,
mock_abmis,
@@ -261,7 +270,14 @@ def test_handle_merge_request_no_deprecate(
mock_abmis.return_value = ([], invalid_bundles)
mock_gid.return_value = 'database/index.db'
mock_om.return_value = 'catalog', 'cache'

mock_get_bundles.return_value = [
{
'bundlePath': 'invalid_bundle:1.0',
'csvName': 'invalid_bundle:1.0',
'packageName': 'invalid_bundle',
'version': '1.0',
},
]
mock_run_cmd.return_value = json.dumps(
{
"schema": "olm.bundle",
@@ -301,6 +317,7 @@ def test_handle_merge_request_no_deprecate(
assert mock_gpb.call_count == 2
mock_abmis.assert_called_once()
mock_gbfdl.assert_called_once()
mock_geaps.assert_called_once()
if invalid_bundles:
if source_fbc:
mock_dep_b_fbc.assert_called_once_with(
@@ -309,6 +326,7 @@ def test_handle_merge_request_no_deprecate(
binary_image='binary-image:1.0',
from_index=mock.ANY,
)
mock_get_bundles.assert_called_once()
assert mock_bi.call_count == 2
assert mock_pi.call_count == 2
else:
@@ -321,9 +339,7 @@ def test_handle_merge_request_no_deprecate(
)
assert mock_bi.call_count == 3
assert mock_pi.call_count == 3
mock_geaps.assert_called_once()
else:
mock_geaps.assert_not_called()
mock_dep_b.assert_not_called()
mock_dep_b_fbc.assert_not_called()
assert mock_bi.call_count == 2