-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat:func to return Count of entities in registry table w/signoff #427
Conversation
Signed-off-by: Jougan-0 <[email protected]>
Signed-off-by: Jougan-0 <[email protected]>
Signed-off-by: Jougan-0 <[email protected]>
@VihasMakwana would you like to offer review on this PR? That would be helpful. |
Signed-off-by: Jougan-0 <[email protected]>
Signed-off-by: Shlok Mishra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from changes, LGTM.
Signed-off-by: Jougan-0 <[email protected]>
Co-authored-by: VihasMakwana <[email protected]> Signed-off-by: Shlok Mishra <[email protected]>
Signed-off-by: Shlok Mishra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the more important use cases to facilitate with these logs is that of when a model or any of its entities is not successful in registering. It's important to be able to give contributors and Meshery administrators as much information as possible about what model and what entity failed to import and why.
Please provide examples of how these logs facilitate the administrator's resolution in the face of these import failures.
Include a link to troubleshooting Docs?
Be aware that both Meshery Server and its clients (Meshery UI and |
Co-authored-by: Lee Calcote <[email protected]> Signed-off-by: Shlok Mishra <[email protected]>
Signed-off-by: Shlok Mishra <[email protected]>
Signed-off-by: Jougan-0 <[email protected]>
Signed-off-by: Jougan-0 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked again:
meshery git:(regLog) make server
cd server; cd cmd; go mod tidy; \
BUILD="v0.7.2-rc-1" \
PROVIDER_BASE_URLS="https://meshery.layer5.io" \
PORT=9081 \
DEBUG=true \
ADAPTER_URLS="localhost:10000 localhost:10001 localhost:10012" \
APP_PATH="./apps.json" \
go run main.go error.go;
# command-line-arguments
./main.go:286:7: log.Infof undefined (type "github.com/layer5io/meshkit/logger".Handler has no field or method Infof)
./main.go:287:41: undefined: meshmodel.NonImportModel
./main.go:289:8: log.Errorf undefined (type "github.com/layer5io/meshkit/logger".Handler has no field or method Errorf)
./main.go:294:48: undefined: meshmodel.RegisterAttempts
make: *** [server] Error 1
Be sure that the PR is building before requesting your next review.
Signed-off-by: Jougan-0 <[email protected]>
We are using a logic of creating a file of registery_attempts.json that stores every entity that failed |
This could be used by the contributors and administrators to resolve the issue related to that entity |
Ready for final review, @Jougan-0? |
@leecalcote final changes suggested by uzair are left will finish it today |
Signed-off-by: Jougan-0 <[email protected]>
@leecalcote PR looks good, can you take a final look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we maintain the error and attempt count in the registration funcs itself?
The registration is done as follows in the |
Signed-off-by: Jougan-0 <[email protected]>
Signed-off-by: Jougan-0 <[email protected]>
return errors.New(ErrWritingRegisteryAttemptsCode, errors.Alert, []string{"Error writing RegisteryAttempts JSON data to file"}, []string{"Error writing RegisteryAttempts JSON data to file:", err.Error()}, []string{}, []string{}) | ||
} | ||
func ErrRegisteringEntity(failedMsg string, hostName string) error { | ||
return errors.New(ErrRegisteringEntityCode, errors.Alert, []string{fmt.Sprintf("The import process for a registrant %s encountered difficulties,due to which %s. Specific issues during the import process resulted in certain entities not being successfully registered in the table.", hostName, failedMsg)}, []string{fmt.Sprintf("For registrant %s %s", hostName, failedMsg)}, []string{"Could be because of empty schema or some issue with the json or yaml file"}, []string{"Check /server/cmd/registery_attempts.json for futher details"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jougan-0 @MUzairS15 this directory will not be present in Meshery deployments. This log file needs to be stored under ~/.meshery/server/registry.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log file location needs to be available in Meshery deployments, not only in local builds. Our standard location for such files is ~/.meshery
Signed-off-by: Jougan-0 <[email protected]>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is being automatically closed due to inactivity. However, you may choose to reopen this issue. |
Description
This PR fixes #
Notes for Reviewers
This function returns the total count of entities in the registries table
Signed commits