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: update operational status endpoint to include 'published' #927

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AlfredNwolisa
Copy link
Contributor

@AlfredNwolisa AlfredNwolisa commented Feb 28, 2025

Summary:

This pr implements the refactoring of operational status to include "published" in the operations_api endpoint and update the null values to published in the database.

Expected behavior:
Feeds can be set to published.

Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).

Screenshot 2025-02-28 at 10 57 34 AM

Testing tips:

Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@AlfredNwolisa AlfredNwolisa linked an issue Feb 28, 2025 that may be closed by this pull request
DO $$
BEGIN
RAISE NOTICE 'Migration completed successfully';
END $$;
Copy link
Contributor

Choose a reason for hiding this comment

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

by convention we name this file feat_<story number> for easier tracking. your changes also need to be in the liquibase/changelog.xml to take effect across environments.

Comment on lines +38 to +46
-- Refresh the materialized view to reflect the changes
DO $$
BEGIN
REFRESH MATERIALIZED VIEW FeedSearch;
RAISE NOTICE 'Refreshed FeedSearch materialized view';
EXCEPTION
WHEN OTHERS THEN
RAISE EXCEPTION 'Failed to refresh FeedSearch materialized view: %', SQLERRM;
END $$;
Copy link
Contributor

Choose a reason for hiding this comment

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

[question] why do we need to refresh the materialized view here?

Copy link
Member

Choose a reason for hiding this comment

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

[question] why do we need to refresh the materialized view here?

It's needed, but we need to update the search queries as part of this PR.

@@ -0,0 +1,52 @@
-- Add 'published' to the OperationalStatus enum if it doesn't exist
Copy link
Contributor

Choose a reason for hiding this comment

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

We should either set the default value of the operational status to published or update the populate script that creates feeds from the catalog repo.

@davidgamez
Copy link
Member

As part of this PR we need to review/update all queries that filter by operational_status; example

Feed.operational_status == None, # noqa: E711

@@ -169,9 +169,12 @@ async def _update_feed(
async def _populate_feed_values(feed, impl_class, session, update_request_feed):
impl_class.to_orm(update_request_feed, feed, session)
action = update_request_feed.operational_status_action
# This is a temporary solution as the operational_status is not visible in the diff
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this comment as the operational_status is still not visible in the operational API until #908 is merged.

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.

Update feeds with null/empty operational status to published
3 participants