Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lock w3up uploads feature switch open #2556

Merged
merged 4 commits into from
Apr 4, 2024
Merged

Conversation

travis
Copy link
Contributor

@travis travis commented Apr 3, 2024

commenting code out here because I'll make a cleanup pass to remove the switch entirely once this is stable in production

commenting code out here because I'll make a cleanup pass to remove the switch entirely once this is stable in production
@travis travis requested a review from gobengo April 3, 2024 18:32
and update assertion in another
Copy link

cloudflare-workers-and-pages bot commented Apr 3, 2024

Deploying nft-storage with  Cloudflare Pages  Cloudflare Pages

Latest commit: 609514a
Status: ✅  Deploy successful!
Preview URL: https://045a82b1.nft-storage-1at.pages.dev
Branch Preview URL: https://feat-w3up-uploads-enabled.nft-storage-1at.pages.dev

View logs

const client = await createClientWithUser(t)
const config = getTestServiceConfig(t)
const mf = getMiniflareContext(t)
// TODO verify with @alanshaw that we don't need to do this in the new upload flow
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alanshaw @vasco-santos could you weigh in on whether this dag-completeness check still needs to happen? it looks like we are still doing this check but maybe need to mock out upload/get in order to get this test passing? it looks like it's failing here because we have not mocked this out: https://github.com/nftstorage/nft.storage/blob/main/packages/api/src/routes/nfts-upload.js#L193

should we mock this out to get the test passing or just skip/remove this test?

Copy link
Contributor

Choose a reason for hiding this comment

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

See https://filecoinproject.slack.com/archives/C031K3BG527/p1712218055251129?thread_ts=1710258503.160809&cid=C031K3BG527

I would say no, but there is some impact that we need to take a more people decision

@travis
Copy link
Contributor Author

travis commented Apr 3, 2024

@alanshaw @vasco-santos - could you two take a look at the tests we're skipping here and verify that they seem like things we no longer need to test? @gobengo and I were just not highly confident and this feels like a good moment to double check that the things these tests are trying to verify are no longer parts of what this code is expected to do...

const client = await createClientWithUser(t)
const config = getTestServiceConfig(t)
const mf = getMiniflareContext(t)
// TODO verify with @alanshaw that we don't need to do this in the new upload flow
Copy link
Contributor

Choose a reason for hiding this comment

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

of course this means we should remove it also from the code

if (stat.structure === 'Partial') {
checkDagStructureTask = async () => {
// @ts-expect-error - I'm not sure why this started failing TODO debug further
const info = await w3up.capability.upload.get(stat.rootCid)
if (info.shards && info.shards.length > 1) {
const structure = await ctx.linkdexApi.getDagStructureForCars(
info.shards
)
if (structure === 'Complete') {
return ctx.db.updatePinStatus(
upload.content_cid,
elasticPin(structure)
)
}
}
}
}

const structure = await ctx.linkdexApi.getDagStructure(s3Backup.key)
if (structure === 'Complete') {
return ctx.db.updatePinStatus(
upload.content_cid,
elasticPin(structure)
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep! I'm planning on removing the whole legacy codepath plus these tests once this is running reliably in production

Co-authored-by: Benjamin Goering <171782+gobengo@users.noreply.github.com>
@gobengo gobengo self-requested a review April 4, 2024 17:31
@gobengo
Copy link
Contributor

gobengo commented Apr 4, 2024

afaict this will be safe. I've been testing uploads from an account allowed by the feature switch, and haven't gotten any errors in prod.

@travis travis merged commit 6eeefeb into main Apr 4, 2024
6 checks passed
@travis travis deleted the feat/w3up-uploads-enabled branch April 4, 2024 20:39
travis pushed a commit that referenced this pull request Apr 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.6.0](api-v4.5.0...api-v4.6.0)
(2024-04-04)


### Features

* added script to generate ucan for w3up space and docs for how to
access the space using console.web3.storage
([#2554](#2554))
([ad33faf](ad33faf))
* lock w3up uploads feature switch open
([#2556](#2556))
([6eeefeb](6eeefeb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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