-
Notifications
You must be signed in to change notification settings - Fork 13
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
Store UGID in group cache to handle group renames at provider's end #647
Conversation
483afc8
to
fee1ce2
Compare
@adombeck Here is my initial work. Could you please check if I am going in right direction? |
Hi @shiv-tyagi, sorry for the late reply, I've been sick for a week.
Yes, I took a quick look and it looks like it's going in the right direction! I'll do a more thorough review once the tests pass and you consider the PR ready for review. Let me know if you need any assistance. |
No worries. Health comes first. |
Ah, I assume it's the golden files which need to be updated. You can update them all at once by running |
I ran this and a lot of golden files did get updated, but the *.db files in the test data like this one still couldn't get updated. Do I need to update them manually or am I missing something? If I am not wrong, golden files are the ones against which the test output is matched, but we also need to update the initial sample db files on which those tests are performed, right? |
Those should also be updated automatically. I ran |
I get this error when I do run the command
I get this error when I run the command. Anything I am missing? |
fb4c819
to
5346307
Compare
Sorry for bugging you so much. I was finally able to run tests and get the cache.db files updated as well. But I still couldn't get these *.db.yaml files updated. Did yours got updated when you ran it locally? |
Just use |
Do you have
|
5346307
to
046924b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #647 +/- ##
==========================================
- Coverage 83.43% 83.10% -0.34%
==========================================
Files 83 88 +5
Lines 8689 8966 +277
Branches 74 74
==========================================
+ Hits 7250 7451 +201
- Misses 1111 1169 +58
- Partials 328 346 +18 ☔ View full report in Codecov by Sentry. |
046924b
to
d48b27b
Compare
That job unfortunately doesn't print its results on the job page, but on the summary page: https://github.com/ubuntu/authd/actions/runs/12152788489/attempts/1?pr=647 |
To catch linter errors earlier, you could install a git pre-push hook which runs golangci-lint locally: $ cat .git/hooks/pre-push
#!/bin/sh
set -eu
set -x
golangci-lint run |
d48b27b
to
ee15013
Compare
Thanks again @adombeck for patiently answering my questions. I am opening the PR for review. Last few questions - I promise :),
|
4ec2473
to
e1ed40b
Compare
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.
This looks very good! Just a few comments.
No problem :)
Currently, we don't have a public chat server or public meetings. I'll mention to the team that you're interested in that, but I can't promise anything 🫤 |
e1ed40b
to
9d54ba1
Compare
9d54ba1
to
16c24ad
Compare
@adombeck Sorry it is taking longer because I am getting less time after work. I only get weekends to contribute. |
12ab536
to
f6d898b
Compare
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.
This looks good to me now, thanks a lot @shiv-tyagi!
@denisonbarbosa @3v1n0 does one of you want to take a look before I merge? |
Thanks @adombeck. |
@denisonbarbosa @3v1n0 ping |
if err != nil && !errors.Is(err, NoDataFoundError{}) { | ||
return err | ||
} | ||
groupExists := !errors.Is(err, NoDataFoundError{}) |
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.
A nit, but I think it becomes clearer with:
groupExists := !errors.Is(err, NoDataFoundError{})
if err != nil && groupExists {
return err
}
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.
LGTM, just a nit to make things a bit more readable.
f6d898b
to
74e0b9a
Compare
Closes #620
UDENG-5160
As suggested by @adombeck, to identify if a group is renamed at provider's end, we should store UGID along with the GID and group name in the cache and find if there is already a group record with same UGID in cache. In case we find one, we delete the record being pointed by old name in relevant buckets and populate with record containing new name.