Skip to content

Conversation

@epou
Copy link
Member

@epou epou commented Sep 3, 2025

No description provided.

@epou epou self-assigned this Sep 3, 2025
@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.68%. Comparing base (c141d50) to head (45c4442).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #318      +/-   ##
==========================================
+ Coverage   50.66%   50.68%   +0.01%     
==========================================
  Files          72       72              
  Lines       10449    10453       +4     
==========================================
+ Hits         5294     5298       +4     
  Misses       5155     5155              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@epou epou requested a review from Copilot September 5, 2025 10:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a POST identification task review feature that allows users with appropriate permissions to review identification tasks by either agreeing with the current classification or overwriting it with a new classification.

  • Add review permission handling in the permission system
  • Add new API endpoint for creating identification task reviews with two types: agree and overwrite
  • Add comprehensive test coverage for the review functionality

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tigacrafting/permissions.py Add ReviewPermission model support to role permission system
tigacrafting/managers.py Update IdentificationTask queryset to include review permissions for browsable filtering
api/views.py Add review endpoint with polymorphic serializer support for agree/overwrite actions
api/tests/test_views.py Add unit tests for both agree and overwrite review functionality
api/tests/integration/identification_tasks/review/schema.yml Add schema validation for integration tests
api/tests/integration/identification_tasks/review/create.tavern.yml Add integration tests for review endpoint permissions and functionality
api/tests/integration/identification_tasks/review/conftest.py Add test fixtures for review integration tests
api/serializers.py Add serializers for review operations and update IdentificationTaskSerializer field names
api/permissions.py Add IdentificationTaskReviewPermissions class for review endpoint authorization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

def validate(self, data):
data = super().validate(data)

# Case Not an insect will be empty taxon. In case of update we need to for it to None
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

Grammar error in comment: 'we need to for it to None' should be 'we need to force it to None'.

Suggested change
# Case Not an insect will be empty taxon. In case of update we need to for it to None
# Case Not an insect will be empty taxon. In case of update we need to force it to None

Copilot uses AI. Check for mistakes.
try:
data['best_photo'] = Photo.objects.get(report=data['report'], uuid=public_photo_uuid)
except Photo.DoesNotExist:
raise serializers.ValidationError("The photo does not does not exist or does not belong to the observation.")
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

Duplicate word in error message: 'does not does not exist' should be 'does not exist'.

Suggested change
raise serializers.ValidationError("The photo does not does not exist or does not belong to the observation.")
raise serializers.ValidationError("The photo does not exist or does not belong to the observation.")

Copilot uses AI. Check for mistakes.
@epou epou merged commit f702931 into master Sep 5, 2025
5 checks 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.

2 participants