Skip to content

Conversation

@GauravJangra9988
Copy link

Closed old pull request #119

This is new pull request solving issue #118

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.45%. Comparing base (0198054) to head (169795b).

Files with missing lines Patch % Lines
crowdin/source_files.go 0.00% 18 Missing ⚠️
crowdin/model/source_files.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #122      +/-   ##
==========================================
- Coverage   98.21%   97.45%   -0.76%     
==========================================
  Files          68       68              
  Lines        3296     3322      +26     
==========================================
  Hits         3237     3237              
- Misses         33       59      +26     
  Partials       26       26              

☔ 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.

@andrii-bodnar andrii-bodnar requested a review from Copilot October 29, 2025 08:44
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 support for Asset Reference operations in the Crowdin API client. Asset references allow attaching reference files to assets for additional context.

Key changes:

  • Added four new API methods for managing asset references: list, add, get, and delete
  • Introduced data models for asset references including request/response structures and user info

Reviewed Changes

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

File Description
crowdin/source_files.go Added four new methods (ListAssetReferences, AddAssetReference, GetAssetReference, DeleteAssetReference) to SourceFilesService for managing asset references
crowdin/model/source_files.go Added data structures for asset references including AddAssetReferenceRequest, UserInfo, AssetReference, and related response types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

StorageID int `json:"storageId"`
Name string `json:"name"`
}

Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The AddAssetReferenceRequest struct is missing a Validate() method. Following the pattern established by similar request structs like FileAddRequest and DirectoryAddRequest, this should include validation to ensure required fields (StorageID and Name) are provided.

Suggested change
// Validate checks if the AddAssetReferenceRequest is valid.
// It implements the crowdin.RequestValidator interface.
func (r *AddAssetReferenceRequest) Validate() error {
if r == nil {
return ErrNilRequest
}
if r.StorageID == 0 {
return errors.New("missing required field: StorageID")
}
if r.Name == "" {
return errors.New("missing required field: Name")
}
return nil
}

Copilot uses AI. Check for mistakes.
@GauravJangra9988
Copy link
Author

@andrii-bodnar hey, i have created a fresh pull reqeust with changes you suggested, but i still creating problem.

As you suggested to run golangci-lint locally i tried that, but it is giving issues in file that i havent changed.

@GauravJangra9988
Copy link
Author

image not getting what error this for

@andrii-bodnar
Copy link
Member

Hi @GauravJangra9988. The issues were clearly outlined in my previous comments and by the Copilot bot. Resolving initial issues based on this documented feedback is a prerequisite for review and a necessary part of the contribution process. I cannot take the time to debug or write the fixes for you. Please resolve all outstanding items independently, then request a new review.

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