Skip to content

Commit

Permalink
cleanup: drop unused LINK_ISOLATION hack
Browse files Browse the repository at this point in the history
This conditional was added as an escape hatch just in case the bug fix
for RHELDST-21893 broke some exodus-gw users and would have to be
temporarily disabled. In practice we never needed to use this and it can
be cleaned up. Link isolation should always be enabled, as originally
intended.
  • Loading branch information
rohanpm committed Dec 13, 2023
1 parent 803d98e commit 9123f7b
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions exodus_gw/models/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@

from .base import Base

# The resolution of links SHOULD be isolated to within the current publish;
# this is very important. However, the original implementation of the code
# did not do that and allowed links to be resolved across any publish,
# see RHELDST-21893.
#
# That is being fixed, but the problem is that clients may have come to
# rely on it. In particular, if pub/pulp/exodus integration is *disabled*,
# we rely on it.
#
# Thus, this semi-hidden setting acts as an escape hatch to re-enable
# the old buggy behavior if it turns out to be needed. Not a proper setting.
#
# Only set this if you really know it's needed! With any luck, this branch
# should be removed quickly.
LINK_ISOLATION = (os.environ.get("EXODUS_GW_LINK_ISOLATION") or "1") == "1"


class Publish(Base):
__tablename__ = "publishes"
Expand Down Expand Up @@ -108,11 +92,9 @@ def resolve_links(
match_bundle: Bundle[Any] = Bundle(
"match", Item.web_uri, Item.object_key, Item.content_type
)
query = db.query(match_bundle).filter(Item.web_uri.in_(ln_item_paths))
if LINK_ISOLATION:
# See comments above where LINK_ISOLATION is set.
# This path should become the only path ASAP!
query = query.filter(Item.publish_id == self.id)
query = db.query(match_bundle).filter(
Item.publish_id == self.id, Item.web_uri.in_(ln_item_paths)
)

matches: dict[str, dict[str, Optional[str]]] = {
row.match.web_uri: {
Expand Down

0 comments on commit 9123f7b

Please sign in to comment.