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

Enhance : Active Projects API #6247

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Conversation

kshitijrajsharma
Copy link
Member

@kshitijrajsharma kshitijrajsharma commented Feb 15, 2024

What does this PR do ?

  • This PR enhances the active projects API by :
    • Fixing bug on UTC timestamp comparison while fetching projects
    • if Project has a comment / conversation happening then that project is also considered as active

Consideration

  • I am aware of performance of the API , I will wait for the multi process approach that's going on before adding enhancement on this endpoint for the consistency

How to test ?

  • I have compared number of projects returned with following query in database directly and from the API endpoint : http://127.0.0.1:5000/api/v2/projects/queries/active/?interval=1
with t1 as (
select distinct  project_id 
from project_chat pc 
WHERE "time_stamp" > (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') - INTERVAL '1 hours'
UNION
SELECT DISTINCT project_id 
FROM task_history 
WHERE action_date > (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') - INTERVAL '1 hours'
)
select count(distinct  project_id)
from t1

Copy link

sonarcloud bot commented Feb 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@kshitijrajsharma kshitijrajsharma marked this pull request as ready for review February 15, 2024 13:59
Copy link
Member

@ramyaragupathy ramyaragupathy left a comment

Choose a reason for hiding this comment

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

Thumbs up with the idea of including project Q&A section

@kshitijrajsharma kshitijrajsharma merged commit 26c533d into develop Feb 19, 2024
8 checks passed
@ramyaragupathy ramyaragupathy added this to the v4.7.1 milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants