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

syndicate API including currently RSS and ATOM formatter API #1188

Open
wants to merge 63 commits into
base: lockhart
Choose a base branch
from

Conversation

rbi-aap
Copy link

@rbi-aap rbi-aap commented May 31, 2024

@marwoodandrew
Copy link
Contributor

It maybe be nice to have some tests like those in newsroom/features/news_api_atom_features! particularly ensuring the product filtering on RSS works as expected!

@MarkLark86
Copy link
Contributor

@rbi-aap @marwoodandrew Is there a Jira ticket (in the SDAN project) with details?

@marwoodandrew
Copy link
Contributor

@rbi-aap @marwoodandrew Is there a Jira ticket (in the SDAN project) with details?

No he doesn't my bad! I'll create one!

@marwoodandrew
Copy link
Contributor

@rbi-aap, @MarkLark86 I've created SDAN-727 I think covers what we're trying to achieve.

@MarkLark86
Copy link
Contributor

@rbi-aap There's a lot of duplication of code. Could you please pull the RSS/ATOM feed formatting code into a common function, that can be used by both the existing blueprints and this new endpoint.

@MarkLark86
Copy link
Contributor

Also, it might be good to avoid that after_request handling and place in another blueprint if you can, which in tern uses the get_internal function from Eve. If need be, you can create a a small Resource/Service to specifically handle the request params etc, but leave the handling for formatting to the blueprint view itself

@rbi-aap
Copy link
Author

rbi-aap commented Sep 10, 2024

Hi Team,
Can you please review the PR ?
please let me know what else i need to add it
the new start ticket is https://sofab.atlassian.net/browse/SDAN-732, thanks

newsroom/companies/views.py Outdated Show resolved Hide resolved
@@ -116,7 +116,17 @@ export function postCompany() {

};
}

export function savePermissions(company, permissions) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The savePermissions function was moved, but the original commented lines above it have not.

/** Save permissions for a company
 *
 */

Copy link
Author

Choose a reason for hiding this comment

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

update,

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment for /** Save permissions for a company still is not in the correct place. Please fix the comment location so it is above the function it is referencing

assets/ui/components/ArticleBodyHtml.jsx Outdated Show resolved Hide resolved
assets/ui/components/ArticleBodyHtml.jsx Outdated Show resolved Hide resolved
assets/ui/components/ArticleBodyHtml.jsx Outdated Show resolved Hide resolved
webpack.config.js Show resolved Hide resolved
from superdesk import get_resource_service


class CompanyFactory:
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of creating your own caching mechanism, you can use existing cache that we're already using (which is also used in this version of newsroom). get_cached_resource_by_id.

Using the get_cached_resource_by_id means this entire module will no longer be needed

Copy link
Author

Choose a reason for hiding this comment

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

temp keep it as it is a session level caching different to the [get_cached_resource_by_id], probably change it in the later version update to V2

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the reason here. Why create a new caching mechanism when we already have one that is used in Production for a long time now, and proven to work. I'm not saying this won't work, but we have something robust and very thoroughly tested.

What benefit does having a session level cache vs an app/redis cache?

Copy link
Author

Choose a reason for hiding this comment

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

The get_cached_resource_by_id can work for sure as it has approved, but please review below reasons for this use case. much appreciate your support

Moving from session-based to app-level caching in CompanyFactory would be a big code change and could cause problems.

Session caching keeps sensitive permission data safe in user sessions and gives more control over caching for each admin user different to normal user and its cache

The current setup works well and fits our needs, so it's probably better to stick with it than spend a lot of time changing things. as it is more than a general cache requirements,

thanks and regards

newsroom/wire/search.py Outdated Show resolved Hide resolved
newsroom/wire/block_media/download_items.py Show resolved Hide resolved
newsroom/wire/block_media/permission_media.py Outdated Show resolved Hide resolved
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