Skip to content

Changing development branch breaks resource embeds in doc #2387

@pushfoo

Description

@pushfoo

Bug Report

Actual behavior:

Audio and music resource embeds for the doc are broken for arcade <= 2.6.17 because resource listing embeds always reference the development branch.

Expected behavior:

Resource embeds point to an appropriate release tag URL.

Why this matters

TL;DR: Long-term reliability for Arcade release doc.

This affects:

  1. The current arcade <= 2.6.17 doc (we moved resources for 3.0)
  2. The EOL 2.6.18 release discussed in the comments of Latest arcade 2.6.17 requires pyglet 2.0.dev23 #2358:
    • It exists to help existing 2.6 projects keep working
    • It will have warnings that 3.0 is imminent + links to upgrade URLs
    • It will be superseded by 3.0 shortly after
  3. 3.0+ (once we release new versions)

Steps to reproduce/example code:

  1. Go to https://api.arcade.academy/en/latest/resources.html?highlight=resources#id22
  2. Observe that all the sound and music embeds are broken

Root cause

See the following line:

RESOURCE_URL = "https://github.com/pythonarcade/arcade/blob/development/{}?raw=true"

Proposed Fix

Update our doc build to use the following logic:

  1. Detect our Arcade version
  2. Does a matching git tag exist on GitHub?
    • Yes: Use a tag-based URL (Example: https://github.com/pythonarcade/arcade/blob/2.6.17/arcade/resources/music/funkyrobot.mp3)
    • No: default to development branch
  3. Write base URL to an env variable or temp file to simplify passing data between scripts?
  4. Update create_resources_listing.py to use the selected base URL for embeds

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions