Skip to content

Conversation

@TheRealSeber
Copy link
Contributor

No description provided.

@TheRealSeber TheRealSeber requested a review from a team as a code owner December 20, 2025 17:21
Copilot AI review requested due to automatic review settings December 20, 2025 17:21
Copy link
Contributor

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 changes the default visibility of newly created tasks from true (globally visible) to false (not visible). The change aligns the application behavior with the database model's default value (gorm:"default:false").

Key Changes:

  • Updated task creation logic to use the provided IsVisible value instead of hardcoding it to true
  • Added isVisible form parameter to the task upload API endpoint (defaults to false when not provided)
  • Enhanced test coverage with a dedicated test for default visibility behavior and refactored test setup using a helper function
  • Updated Docker Compose configuration to use GitHub Container Registry images

Reviewed changes

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

File Description
package/service/task_service.go Changed IsVisible assignment from hardcoded true to use the value from the input schema
internal/api/http/routes/tasks_management.go Added parsing of optional isVisible form parameter with default value of false and updated Swagger documentation
package/service/task_service_test.go Refactored test setup with helper function, added tests for default and custom visibility, and updated existing test cases with proper mock controller lifecycle
docker-compose.yaml Removed pull_policy: never from worker service and updated frontend image to use GitHub Container Registry

CreatedBy: adminUser.ID,
IsVisible: true,
}
ur.EXPECT().Get(gomock.Any(), gomock.Any()).Return(&models.User{ID: 1, Role: types.UserRoleAdmin}, nil).Times(1)
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The test name "Custom visibility" is misleading because it tests setting IsVisible to false, which is now the default behavior (same as the "Success" test). This test should either:

  1. Test setting IsVisible to true (which would be a true custom/non-default value), or
  2. Be renamed to better reflect what it's actually testing (e.g., "Explicitly set visibility to false")

Copilot uses AI. Check for mistakes.
Comment on lines +160 to 169
return int64(2), nil
}).Times(1)
acs.EXPECT().GrantOwnerAccess(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).Times(1)

taskID, err := ts.Create(db, adminUser, task)
require.NoError(t, err)
assert.Equal(t, int64(2), taskID)
})

t.Run("Non unique title", func(t *testing.T) {
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

This test should verify that IsVisible is set to true to properly test custom (non-default) visibility. Currently, it's testing false, which is the same as the default behavior tested in the "Success" test case. Change line 163 to IsVisible: true and update line 168 to assert.True(t, model.IsVisible) to ensure this test actually validates custom visibility behavior.

Copilot uses AI. Check for mistakes.
@TheRealSeber
Copy link
Contributor Author

@copilot please adjust according to comments if reasonable

Copy link
Contributor

Copilot AI commented Dec 20, 2025

@TheRealSeber I've opened a new pull request, #227, to work on those changes. Once the pull request is ready, I'll request review from you.

@TheRealSeber TheRealSeber merged commit e0f4ef5 into master Dec 20, 2025
6 checks passed
@TheRealSeber TheRealSeber deleted the feat-make-tak-invisible-on-creation branch December 20, 2025 17:35
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