Skip to content

Conversation

@whitead
Copy link
Collaborator

@whitead whitead commented Nov 2, 2025

see title


Note

Extracts OPENALEX_HOST and constructs OPENALEX_BASE_URL from it in the OpenAlex client.

  • Clients/OpenAlex:
    • Define OPENALEX_HOST and derive OPENALEX_BASE_URL from it.

Written by Cursor Bugbot for commit 068c79e. Configure here.

Copilot AI review requested due to automatic review settings November 2, 2025 05:55
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 2, 2025
@dosubot
Copy link

dosubot bot commented Nov 2, 2025

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added the enhancement New feature or request label Nov 2, 2025
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

This PR extracts the OpenAlex host into a separate constant to improve configurability and maintainability. The base URL construction is now more explicit and allows for easier host override if needed.

  • Extracted OPENALEX_HOST constant from the hardcoded URL string
  • Refactored OPENALEX_BASE_URL to use f-string formatting with the new constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

from .exceptions import DOINotFoundError

OPENALEX_BASE_URL = "https://api.openalex.org"
OPENALEX_HOST = "api.openalex.org"
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

[nitpick] The newly introduced OPENALEX_HOST constant appears to be unused outside of constructing OPENALEX_BASE_URL. If the intent is to allow host configuration via environment variables (similar to OPENALEX_API_REQUEST_TIMEOUT), consider adding support for this. Otherwise, this intermediate constant adds unnecessary indirection without clear benefit. Recommend either removing it and reverting to the original single-line definition, or documenting its purpose if it's intended for future extensibility.

Copilot uses AI. Check for mistakes.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 2, 2025
@whitead whitead merged commit 3a03ab6 into main Nov 2, 2025
12 of 14 checks passed
@whitead whitead deleted the oa-host branch November 2, 2025 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants