Skip to content

AO3-6978 Create and fill new table for import urls#5659

Open
luis-pabon-tf wants to merge 21 commits intootwcode:masterfrom
luis-pabon-tf:AO3-6978
Open

AO3-6978 Create and fill new table for import urls#5659
luis-pabon-tf wants to merge 21 commits intootwcode:masterfrom
luis-pabon-tf:AO3-6978

Conversation

@luis-pabon-tf
Copy link
Copy Markdown
Contributor

@luis-pabon-tf luis-pabon-tf commented Mar 23, 2026

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6978

Purpose

Step 1 of moving imported URLs to a new table to store all searchable variations.

Testing Instructions

Besides the steps on the Jira, you can check that the task works by checking ImportedUrl.last on the Rails console.

References

Are there other relevant issues/pull requests/mailing list discussions? If not, you can remove this section.
AO3-6979 follows up on this one
AO3-6591 Is the parent both tickets belong to

Credit

What name and pronouns should we use to credit you in the Archive of Our Own's Release Notes?
Luis Pabon (they/he)

@github-actions github-actions bot added Has Migrations Contains migrations and therefore needs special attention when deploying Awaiting Review labels Mar 23, 2026
Copy link
Copy Markdown
Member

@brianjaustin brianjaustin left a comment

Choose a reason for hiding this comment

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

Thanks! One thing for the test. Also, could you add a test for the rake task?

Comment on lines +7 to +14
t.string :minimal, null: false
t.string :minimal_no_protocol_no_www, null: false
t.string :no_www, null: false
t.string :with_www, null: false
t.string :with_http, null: false
t.string :with_https, null: false
t.string :encoded, null: false
t.string :decoded, null: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We may want indexes on some of these later, but since indexes aren't totally free, I'm fine not doing that for now to see how MariaDB optimises as-is (still better than a query starting with a wildcard 😅 )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was thinking that it would be better to add indexes once the new tables are usable to see which columns would actually benefit.

Comment on lines +11 to +18
expect(url.minimal).to eq(formatter.minimal)
expect(url.minimal_no_protocol_no_www).to eq(formatter.minimal_no_protocol_no_www)
expect(url.no_www).to eq(formatter.no_www)
expect(url.with_www).to eq(formatter.with_www)
expect(url.with_http).to eq(formatter.with_http)
expect(url.with_https).to eq(formatter.with_https)
expect(url.encoded).to eq(formatter.encoded)
expect(url.decoded).to eq(formatter.decoded)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To make it easier to see what each of these represents, could you make these be raw strings (so for example expect(url.minimal).to eq("http://www.trickster.org/llwyden/misc/cracked.html") instead of the first line)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Coder Has Actioned Review Has Migrations Contains migrations and therefore needs special attention when deploying

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants