Skip to content

Module-level mapping.js overrides instance-level overrides in Docker build #3034

Open
@Samk13

Description

@Samk13

Package version (if known): (uv 0.6.17+ rspack, V12)

Describe the bug

With uv + rspack, component overrides are defined in var/instance/assets/js/invenio_app_rdm/overridableRegistry/mapping.js
work locally but disappear in the Docker image "undeterministically".

Inside the container, the registry comes from the module’s own mapping.js , so only:

export const overriddenComponents = {
  "TimelineFeed.header": TimelineFeedHeader,
};

is kept, overwriting instance entries such as

"InvenioAppRdm.Deposit.CommunityHeader.container": () => null

As a result:
Custom Deposit overrides are missing in the container.

Steps to Reproduce

  1. Setup with uv using this this base image:
  2. Register overrides in mapping.js:
export const overriddenComponents = {
  "InvenioAppRdm.Deposit.CommunityHeader.container": () => null,
};
  1. Build and run with Docker using the Dockerfile from this base image
  2. Inspect the mapping.js in the container, and notice the difference with the local setup.

Expected behavior

Instance-level overrides should always win, both locally and in Docker.

Additional context

pyproject.yaml I used in the setup

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "my-site-test"
description = "RDM test"
readme = "README.md"
requires-python = ">= 3.12"
version = "0.12.8"

dependencies = [
  "invenio-app-rdm[opensearch2]~=12.0.0",
  "lxml-html-clean>=0.1.1",
  "python-dotenv>=0.21.0",
  "invenio-logging[sentry]~=2.1.5",
  "uwsgi-tools>=1.1.1",
  "uwsgitop>=0.11",
  "uwsgi>=2.0",
  "my-site",
]

[tool.uv.sources]
my-site = { workspace = true }

[tool.uv.workspace]
members = ["site"]


[tool.hatch.build.targets.wheel]
packages = ["site"]

[tool.setuptools]
py-modules = []

site/pyproject.toml

[project]
name = "my-site"
description = "my-site package"
readme = "README.md"
requires-python = ">= 3.12"
dynamic = ["version"]

[tool.hatch.version]
path = "my_site/__init__.py"

[build-system]
requires = ["hatchling", "babel>2.8"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
    "invenio-app-rdm[opensearch2]~=12.0.0",
    "pytest-black-ng>=0.4.1",
    "pytest-invenio>=2.1.0,<3.0.0",
    "pytest-mock>=3",
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions