Skip to content

Fix importbot + make runnable locally - #12999

Merged
mekarpeles merged 1 commit into
internetarchive:masterfrom
cdrini:fix/importbot
Jun 22, 2026
Merged

Fix importbot + make runnable locally#12999
mekarpeles merged 1 commit into
internetarchive:masterfrom
cdrini:fix/importbot

Conversation

@cdrini

@cdrini cdrini commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

There was an indenting issue introduced by I believe copilot in #12902 .

Also:

  • Adds importbot to the near-prod compose file for easy startup locally
  • Fixed the login call to use the email instead of username, which is required for login now

Technical

Testing

Confirmed locally starts up and picks up items from import_item .

Screenshot

Stakeholders

@cdrini cdrini added the Priority: 1 Do this week, receiving emails, time sensitive, . [managed] label Jun 22, 2026
Comment thread openlibrary/api.py
def import_data(self, data, headers=None):
headers = {"Content-Type": "application/json", **(headers or {})}
return self._request("/api/import", method="POST", data=data, headers=headers).text
def import_data(self, data):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This indenting issue made the method uncallable ; which has likely killed importbot since the deploy!

Comment thread scripts/manage-imports.py
if os.getenv("LOCAL_DEV"):
ol = OpenLibrary(base_url="http://localhost:8080")
ol.login("admin", "admin123")
ol.login("openlibrary@example.com", "admin123")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A while back login via the /account/login API stopped working with username and requires email.

@mekarpeles
mekarpeles merged commit 6ccd49b into internetarchive:master Jun 22, 2026
4 checks passed
@cdrini
cdrini deleted the fix/importbot branch June 22, 2026 17:19
mekarpeles added a commit that referenced this pull request Jun 24, 2026
docs(ai/imports): update for PR #12999 β€” importbot now runnable locally
pull Bot pushed a commit to iAMX11/openlibrary that referenced this pull request Jun 24, 2026
… runnable locally

- index.md: update manage-imports.py description + add compose.near-prod.yaml entry;
  mark internetarchive#7236 fixed
- debugging.md: replace 'ImportBot does not run' limitation with how-to,
  including env vars, docker compose command, and dev account credentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 1 Do this week, receiving emails, time sensitive, . [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants