Skip to content

Conversation

@cdrini
Copy link
Collaborator

@cdrini cdrini commented Jul 24, 2025

Small extension to make deploying PRs a little bit easier. This way we can deploy the past commits as well as the current ones.

Technical

Testing

Screenshot

image

Stakeholders

@cdrini cdrini force-pushed the feature/testing-prs-link branch from 77d94b1 to c729be0 Compare July 24, 2025 21:14
@cdrini cdrini force-pushed the feature/testing-prs-link branch from c729be0 to 50cd53c Compare July 24, 2025 21:15
@cdrini cdrini marked this pull request as ready for review July 24, 2025 21:18
@Copilot Copilot AI review requested due to automatic review settings July 24, 2025 21:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a GitHub link to the status page that allows users to view pull requests directly on GitHub, making it easier to deploy both current and past commits.

  • Adds a new method get_github_search_link() to construct GitHub search URLs for PRs
  • Updates the status page template to include a "View PRs on GitHub" link
  • Adds internationalization support for the new link text

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
openlibrary/plugins/openlibrary/status.py Implements GitHub search URL construction method
openlibrary/templates/status.html Adds GitHub link UI element to status page
openlibrary/i18n/messages.pot Adds translation entry for new link text


def get_github_search_link(self) -> str:
"""Constructs a GitHub search URL for all PRs in pr_statuses."""
from urllib.parse import urlencode
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement should be moved to the top of the file with other imports rather than inside the method to follow Python best practices and improve readability.

Suggested change
from urllib.parse import urlencode

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RayBB hmm shouldn't this have been automatically done by pre-commit?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pre-commit orders imports at the top of file but it won't complain about imports in functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that something we could enable? It would be good if we had to explicitly tag these kinds of imports.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cdrini turns out we don't have it because we're on an old version of ruff :')

@mekarpeles mekarpeles merged commit 0d390a6 into internetarchive:master Jul 24, 2025
4 checks passed
@mekarpeles
Copy link
Member

great quality of life devops improvement, ty Drini!

@cdrini cdrini deleted the feature/testing-prs-link branch July 25, 2025 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants