• 
      

    Port to the new Page Banner support, and add can-close settings.

    Review Request #14560 — Created Aug. 7, 2025 and updated

    Information

    rb-extension-pack
    master

    Reviewers

    When run on Review Board 7.1+, the Message of the Day banner will now
    make use of the new standard Page Banner UI component, which takes care
    of all the presentation of banners. This creates a more consistent look
    and helps make this extension more future-proof.

    When run on older versions, the banner will continue to handle all
    presentation and placement as before.

    This is implemented as two entirely separate TemplateHooks. They
    calculate similar state, but behave a bit differently under the hood,
    particularly with the visibility state.

    There's also a new feature allowing administrators to control whether
    users can close this banner. This can be turned off if the banner is
    something that needs to always be seen (such as important user
    instructions, legal notices, outages, etc.).

    This will all be for the upcoming 4.0 release.

    Tested on Review Board 7.0 and 7.1, with and without the option
    for letting users close banners.

    Tested the closing and should-render functionality on both.

    Inspected the generated HTML and scripts for all verson/setting
    combinations.

    Summary ID
    Port to the new Page Banner support, and add can-close settings.
    When run on Review Board 7.1+, the Message of the Day banner will now make use of the new standard Page Banner UI component, which takes care of all the presentation of banners. This creates a more consistent look and helps make this extension more future-proof. When run on older versions, the banner will continue to handle all presentation and placement as before. This is implemented as two entirely separate `TemplateHooks`. They calculate similar state, but behave a bit differently under the hood, particularly with the visibility state. There's also a new feature allowing administrators to control whether users can close this banner. This can be turned off if the banner is something that needs to always be seen (such as important user instructions, legal notices, outages, etc.). This will all be for the upcoming 4.0 release.
    67b7af662f512e6bd3471a876c183e497692c63b
    Description From Last Updated

    Did you forget to add the scripts.html file?

    daviddavid

    This needs a Version Changed for the rename, and shouldn't we keep the old name around and use housekeeping's "class …

    maubinmaubin

    Nit: we only use this variable in one place (after getting rid of the debug print), we could instead inline …

    maubinmaubin

    Leftover debug code.

    maubinmaubin

    Nit: we only use this variable in one place, we could instead inline this in the dict definition.

    maubinmaubin

    While we're doing this can we explicitly type as tuple[int, int, int, int, str, int, bool]? Otherwise version comparisons get …

    daviddavid

    Typo: single backtick at the end instead of double.

    daviddavid

    Typo: utilizies -> utilizes

    daviddavid

    Can we switch to an f-string?

    daviddavid

    Just for extra sanity, should we check that the message isn't empty?

    daviddavid

    Can we switch to an f-string?

    daviddavid
    david
    1. 
        
    2. Show all issues

      Did you forget to add the scripts.html file?

    3. 
        
    chipx86
    maubin
    1. 
        
    2. rbmotd/rbmotd/extension.py (Diff revision 2)
       
       
      Show all issues

      This needs a Version Changed for the rename, and shouldn't we keep the old name around and use housekeeping's "class moved" decorator? I know these are internal to the MOTD extension but aren't they technically still public.

      1. Nobody is using this code as an API. For extensions like this we want to maintain compatibility and potentially do deprecation cycles for functionality, but we don't need to maintain API stability the way we do in our other code.

    3. rbmotd/rbmotd/extension.py (Diff revision 2)
       
       
      Show all issues

      Nit: we only use this variable in one place (after getting rid of the debug print), we could instead inline this in the dict definition.

    4. rbmotd/rbmotd/extension.py (Diff revision 2)
       
       
      Show all issues

      Leftover debug code.

    5. rbmotd/rbmotd/extension.py (Diff revision 2)
       
       
      Show all issues

      Nit: we only use this variable in one place, we could instead inline this in the dict definition.

    6. 
        
    chipx86
    maubin
    1. Ship It!
    2. 
        
    david
    1. 
        
    2. rbmotd/rbmotd/__init__.py (Diff revision 3)
       
       
      Show all issues

      While we're doing this can we explicitly type as tuple[int, int, int, int, str, int, bool]? Otherwise version comparisons get flagged because the implicit type for this uses Literal (would also need __future__.annotations import)

    3. rbmotd/rbmotd/extension.py (Diff revision 3)
       
       
      Show all issues

      Typo: single backtick at the end instead of double.

    4. rbmotd/rbmotd/extension.py (Diff revision 3)
       
       
      Show all issues

      Typo: utilizies -> utilizes

    5. 
        
    chipx86
    Review request changed
    Change Summary:
    • Added typing for VERSION.
    • Fixed issues in docstrings.
    Commits:
    Summary ID
    Port to the new Page Banner support, and add can-close settings.
    When run on Review Board 7.1+, the Message of the Day banner will now make use of the new standard Page Banner UI component, which takes care of all the presentation of banners. This creates a more consistent look and helps make this extension more future-proof. When run on older versions, the banner will continue to handle all presentation and placement as before. This is implemented as two entirely separate `TemplateHooks`. They calculate similar state, but behave a bit differently under the hood, particularly with the visibility state. There's also a new feature allowing administrators to control whether users can close this banner. This can be turned off if the banner is something that needs to always be seen (such as important user instructions, legal notices, outages, etc.). This will all be for the upcoming 4.0 release.
    5e489e65cbdfff4e30785a6dae9031828f7e821b
    Port to the new Page Banner support, and add can-close settings.
    When run on Review Board 7.1+, the Message of the Day banner will now make use of the new standard Page Banner UI component, which takes care of all the presentation of banners. This creates a more consistent look and helps make this extension more future-proof. When run on older versions, the banner will continue to handle all presentation and placement as before. This is implemented as two entirely separate `TemplateHooks`. They calculate similar state, but behave a bit differently under the hood, particularly with the visibility state. There's also a new feature allowing administrators to control whether users can close this banner. This can be turned off if the banner is something that needs to always be seen (such as important user instructions, legal notices, outages, etc.). This will all be for the upcoming 4.0 release.
    67b7af662f512e6bd3471a876c183e497692c63b

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.
    david
    1. 
        
    2. rbmotd/rbmotd/extension.py (Diff revision 4)
       
       
      Show all issues

      Can we switch to an f-string?

    3. rbmotd/rbmotd/extension.py (Diff revision 4)
       
       
       
       
       
       
      Show all issues

      Just for extra sanity, should we check that the message isn't empty?

    4. rbmotd/rbmotd/extension.py (Diff revision 4)
       
       
      Show all issues

      Can we switch to an f-string?

    5.