lrivallain/azure_docs_watchergithub_client.py

Last 6 commits touching this section.

7d42b71

Fix the 500 on every commit view and pin the runtime contract `datetime.UTC` is an alias introduced in Python 3.11. The Azure App Service runs Python 3.10, so parsing a commit date raised AttributeError: module 'datetime' has no attribute 'UTC' on every request that listed commits. Pages that do not parse a date, the home page and the section index, kept working, which is why the failure looked like it was limited to one repository. The alias was not written by hand: ruff's UP017 rewrote the portable `datetime.timezone.utc` into it, because `target-version` claimed 3.13 while production had 3.10. The CI installed 3.13 too, so nothing ever exercised the runtime that actually serves the application. Three changes, so this class of failure cannot come back: * the portable `datetime.timezone.utc` spelling is used again, which runs on both versions and makes the runtime bump safe to land in either order; * the tests run on the deployed runtime as well as the target one, and UP017 is disabled until the App Service has been bumped; * the README documents that the App Service runtime, the CI matrix and the linter target have to be kept in step, with the command to raise the runtime. Verified on a real 3.10 interpreter: the reported URL and every other commit view answer 200, the suite passes on 3.10 and 3.13, and reintroducing the alias fails 17 tests on 3.10. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 372234e2-8676-4a29-8c30-4e689a0a406a

f2c087c

Pre-configure the repositories azure-docs was split into Microsoft has been carving MicrosoftDocs/azure-docs into per-domain repositories. Virtual machines, AKS, Cosmos DB, Monitor, AI services, machine learning and Defender for Cloud are no longer in it, so the curated list had quietly lost most of the services it advertises. This follows that content to its new homes and adds the guidance repositories alongside it. Their default branches are not uniform, which the branch autodiscovery already handles: defender-docs publishes from `public`, sql-docs from `live`. Repositories with no product icon now render a Bootstrap glyph through a shared macro, which also fixes an unguarded <img> on the home page that would have rendered a broken image for any entry without one. Section listings drop the dot and underscore prefixed tooling folders, which are not documentation. Every configured repository was verified end to end: index page, first section and its RSS feed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 372234e2-8676-4a29-8c30-4e689a0a406a

254dccc

Simplify the configuration and polish the commit list AZDOCSWATCH_MAX_COMMITS could only lower a count that GitHub already fixes at the feed size, so it was a knob that could never help. The remaining constant is no longer configurable and only tells visitors when a listing is capped, hence its rename to ATOM_FEED_SIZE. Also renames the header "About" entry to "GitHub", which is what it links to, and highlights a commit card with a coloured border when it is pointed at or keyboard focused. The rule lives in a static stylesheet rather than inline, and is disabled under prefers-reduced-motion. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 372234e2-8676-4a29-8c30-4e689a0a406a

02a7cdc

Always show the 20 most recent commits instead of a look-back window GitHub caps commit feeds at 20 non paginated entries with no date filter, so a look-back window could only ever hide results that had already been fetched. It also made quiet sections useless: a section whose last change is older than the window reported no activity at all, when what a reader wants to know is precisely when it last changed. `articles/aks` for instance now shows its real history from 2024 rather than "No commit in the last 5 days". Removes the "Look back over" control, the `since` parameter and the `AZDOCSWATCH_SINCE` and `AZDOCSWATCH_MAX_SINCE` settings. Existing links and feed subscriptions carrying `?since=` keep working, the parameter is ignored. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 372234e2-8676-4a29-8c30-4e689a0a406a

1a515a9

Do not let low level I/O failures escape as unhandled errors requests.exceptions.RequestException derives from OSError, so catching OSError covers both the request level failures and the lower level ones that were escaping, such as an unusable TLS CA bundle. Those surfaced as a bare 500 instead of the error page, with no indication of the cause. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 372234e2-8676-4a29-8c30-4e689a0a406a

e8828a0

Drop the GitHub credential requirement and modernize the app The shared GITHUB_ACCESS_TOKEN had become a recurring chore: organizations can cap personal access token lifetimes to a few days, so the deployment depended on a manual renewal. Commits are now read from the public Atom feeds published by the GitHub web front-end, which need no credential and consume no REST API rate limit. The default branch is discovered from the branch-less feed title, which is required because repositories disagree on it (sql-docs uses `live`). The only remaining REST call is the directory listing, performed anonymously and cached. The oAuth login was removed with it: it only existed to raise limits that no longer apply, and it was the sole source of the SAML enforcement problem (#10). The `since` control is now available to everyone. Known limitation: GitHub serves commit feeds as a single, non paginated page of 20 entries, so a section can never show more than 20 commits. The previous implementation was capped at 20 too, so this is not a regression. Also fixed along the way: * RSS entries were published oldest first, and the channel link pointed at the feed instead of the HTML page. * The RSS author was an email field holding a display name; it is now dc:creator. * Commit messages were HTML escaped before being XML escaped, producing double escaped entities in the feeds. * A NameError was raised instead of the intended error page on GitHub failures. * The Flask secret key was regenerated on every start, breaking sessions across restarts and workers. * The page language was declared as French while the interface is English. Modernization: * Bootstrap 5.3 native colour modes replace the abandoned bootstrap-dark-5 fork; jQuery and js-cookie are gone and CDN assets are pinned with SRI. * Pages advertise their RSS feed through autodiscovery links. * PyGithub, flask_dance, authlib and Flask-Login dropped; dependencies pinned. * Added an offline test suite, ruff linting and formatting, and a CI workflow that lints and tests before deploying. The previous workflow relied on the retired v2 artifact actions and could no longer run. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 372234e2-8676-4a29-8c30-4e689a0a406a