Skip to content

Model subfeed methods#519

Merged
ao-david merged 3 commits intomainfrom
model-subfeed-methods
Apr 21, 2025
Merged

Model subfeed methods#519
ao-david merged 3 commits intomainfrom
model-subfeed-methods

Conversation

@ao-david
Copy link
Member

Add methods and testing for subfeed methods.

@ao-david ao-david self-assigned this Mar 13, 2025
}

// Clear any existing subfeeds.
store.Delete(ctx, store.NameKey(typeSubFeed, fmt.Sprintf("%d.%d", testSubFeedFeedID, testSubFeedID)))
Copy link
Member

Choose a reason for hiding this comment

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

I think you should consider using t.Cleanup for any sort of DB type testing, then you shouldn't need to do this. I also think it might be better to just do a check for any existing stuff, and panic if it's there; we don't expect anything in the file DB for the start of a test right ? Doing this hides any test cleanup issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would you recommend that the cleanup function deletes the directory directly instead of the entities

Copy link
Member

Choose a reason for hiding this comment

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

Yes actually. I guess it should get rid of anything that wasn't there before the testing.

store.Delete(ctx, store.NameKey(typeSubFeed, fmt.Sprintf("%d.%d", testSubFeedFeedID, testSubFeedID+1)))

startTime := time.Now().UTC().Truncate(0)
finishTime := startTime.Add(1 * time.Hour)
Copy link
Member

Choose a reason for hiding this comment

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

Does 1 hour have any significance, or just arbitrary ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just an arbitrary time so that they are different (not that it really matters)

Copy link
Member

Choose a reason for hiding this comment

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

Maybe comment that it's arbitrary

Copy link
Member

@saxon-milton saxon-milton left a comment

Choose a reason for hiding this comment

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

version bump

This change adds a subfeed which captures all the information about a short-lived instance of a feed.
@ao-david ao-david force-pushed the model-subfeed-methods branch from 13e4904 to 82dda89 Compare April 14, 2025 07:07
This change adds a cleanup function to remove the entities created by previous test runs.
@ao-david ao-david force-pushed the model-subfeed-methods branch from 82dda89 to 2a497ce Compare April 14, 2025 07:08
@ao-david
Copy link
Member Author

version bump

We don't have a version number for model, the only version number that we have for it is the global cloud repo version tag, which I will update once this has been merged.

@ao-david ao-david requested a review from saxon-milton April 16, 2025 23:29
@ao-david ao-david merged commit 171ab06 into main Apr 21, 2025
1 check passed
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