Skip to content

DOCSP-57250: Reflect dataset limitation around movie year (no data 2016+)#80

Merged
cbullinger merged 7 commits intodevelopmentfrom
docsp-57250-movie-year
Jan 30, 2026
Merged

DOCSP-57250: Reflect dataset limitation around movie year (no data 2016+)#80
cbullinger merged 7 commits intodevelopmentfrom
docsp-57250-movie-year

Conversation

@cbullinger
Copy link
Collaborator

@cbullinger cbullinger commented Jan 28, 2026

  • Update all three READMEs to acknowledge the dataset limitation
  • Update the frontend to reflect the lack of movies if user tries to filter outside the dynamically detected year range:
image image

NOTE: with freshly installed sample data, these are the warnings you'll see. the add and edit functionality is still hardcoded to accept 1800+ (min) to current year + 5 (max), so you could potentially add/edit a movie to be 1800 (min) or 2031 (max). the filter would dynamically detect these new ranges.
BUUUT...the year field isn't required, so you could also potentially have blank (0) years.

  • Add tests to all three backends around year validation
  • Also added a poster URL validation to address the following error encountered when testing the filter, caused by an invalid or malformed poster field:
    Failed to parse src "string" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)
    

@cbullinger cbullinger changed the base branch from main to development January 28, 2026 17:46
Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

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

Few comments re: the JS/Express server implementation, but I'll pause here based on our convo on Zoom re: making the year detection dynamic.

- Remove hardcoded year bounds (1800-2030) from all three backends
- Backend aggregations now only validate year field is numeric (: number)
- Add fetchYearBounds() on client to dynamically detect min/max years from data
- Move dataset warning above Year field label in FilterBar
- Update tests to reflect removed year bound validation

Backends modified: Java Spring, Express, Python FastAPI
Client modified: FilterBar.tsx, api.ts
The Atlas CLI local deployment creates a replica set (myLocalRs1) that
advertises hostname 'mylocalrs1'. Without directConnection=true, the
MongoDB driver attempts server discovery and fails to resolve this
hostname in CI, causing all tests to fail with:
MongoServerSelectionError: getaddrinfo EAI_AGAIN mylocalrs1
Copy link
Collaborator

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

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

Changes look good with some minor tweaks, but I did spot an unrelated issue during testing that we probably want to cut a ticket for.

loadGenres();
}, []);

// Fetch year bounds from the API on mount
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉

Love this approach - seems much cleaner.

if genre:
filter_dict["genres"] = {"$regex": genre, "$options": "i"}
if year:
if isinstance(year, int):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems unrelated to this change, but if I try to filter only based on year, the FastAPI server is throwing an error. Looks like it's expecting a minimum IMDB rating when we try to apply a filter, and since there is no default value coming from the client, it's blowing up.

I suspect this is not the desired behavior, but since it's unrelated to this change, maybe we want to cut a separate ticket to address it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

weird, I'm not getting any error when only filtering by year with the FastAPI server... 🤔 but I'll cut a ticket to look into it!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cbullinger and others added 4 commits January 30, 2026 11:04
- Quote all references to $GITHUB_STEP_SUMMARY to prevent bash syntax errors
  when the variable is empty or unset
- Add guard at script start to gracefully skip summary generation if
  GITHUB_STEP_SUMMARY is not set

This fixes the 'Generate Test Summary' step failure in CI where unquoted
variable references caused 'echo >> ' syntax errors with set -e enabled.
Create index on comments.movie_id after data restore to fix the
/reportingByComments aggregation timeout. Without this index, the
$lookup operation performs a full collection scan (41K comments x 21K
movies) causing 5+ minute response times in CI vs ~700ms locally.
The previous commit added an index creation step that requires mongosh,
but mongosh is not installed on the Ubuntu runner by default.
This adds a step to download and install mongosh-2.3.8-linux-x64.
Co-authored-by: Dachary <dachary.carey@mongodb.com>
@cbullinger
Copy link
Collaborator Author

Unrelated, but had to also make some updates to the Express Tests workflow so it'd pass without timing out or returning no test summary

@cbullinger cbullinger merged commit dfdff26 into development Jan 30, 2026
4 checks passed
@cbullinger cbullinger deleted the docsp-57250-movie-year branch February 9, 2026 20:41
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.

2 participants