Skip to content
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

not_landed script is making two separate requests to get user IDs and user nicks #1101

Open
marco-c opened this issue Apr 14, 2021 · 14 comments

Comments

@marco-c
Copy link
Contributor

marco-c commented Apr 14, 2021

BugzillaUser(
and
BugzillaUser(
.

@Ayushsunny
Copy link

Hello @marco-c as this is a good first issue, I would like to fix it.
please guide me sir

@marco-c
Copy link
Contributor Author

marco-c commented Apr 24, 2021

Hello @Ayushsunny, you will need to modify the script in auto_nag/scripts/not_landed.py to avoid the BugzillaUser(...).wait() call in the get_nicks function and directly get the nicks in the get_bz_userid function (add nick to include_fields and update

data[str(user["id"])] = user["name"]
to store both the name and the nick.

You can test the script by running python -m auto_nag.scripts.not_landed --dryrun.

@Ayushsunny
Copy link

Ayushsunny commented Apr 24, 2021

@marco-c I'm trying to run python -m auto_nag.scripts.stepstoreproduce --dryrun and I get an error: FileNotFoundError: [Errno 2] No such file or directory: './auto_nag/scripts/configs/config.json'

I've cloned relman-auto-nag and installed all dependencies in a fresh virtualenv.

@marco-c
Copy link
Contributor Author

marco-c commented Apr 26, 2021

@Ayushsunny sorry I forgot to mention you'd need to create that file with the following format:

{
    "bz_api_key": "YOUR_BUGZILLA_API_KEY",
    "phab_api_key": "YOUR_PHABRICATOR_API_KEY"
}

To get a Bugzilla and a Phabricator key, you'll need to register on https://bugzilla.mozilla.org/home and then on https://phabricator.services.mozilla.com/.

@Ayushsunny
Copy link

@marco-c Thank you so much sir for the json problem.

Okay so we're going to make changes like this

   def handler(user, data):
        data[str(user["id"])] = user["name"]

    data = {}
    BugzillaUser(
        user_names=list(users.values()),
        include_fields=["id", "name", "nick"],
        user_handler=handler,
        user_data=data,
    ).wait()

right sir?

@marco-c
Copy link
Contributor Author

marco-c commented Apr 26, 2021

@Ayushsunny yes, that's one of the things you will have to modify.

@Ayushsunny
Copy link

@marco-c could you please review this PR

@DharmikNaik
Copy link

DharmikNaik commented Jun 14, 2021

data[str(user["id"])] = user["name"]

I would like to know if we need to use a particular data structure for storing both name and nick? I am thinking of storing them as a tuple.

Please guide me.

@marco-c
Copy link
Contributor Author

marco-c commented Jun 14, 2021

You can store them as a dict {"name": name, "nick": nick}.

@Jubintgh
Copy link

Hi @marco-c is this bug still open? in that case how can I get added to the repo

Thanks

@marco-c
Copy link
Contributor Author

marco-c commented Mar 15, 2024

Yes, you can work on this.
You don't need to be added to the repo, you can open a pull request from your own fork of the repo.

@Jubintgh
Copy link

Jubintgh commented Mar 15, 2024

thanks, I'm not familiar with your review process, should I add reviewers myself or would it be picked up once PR is in?
in either case here's my PR: #2365

@suhaibmujahid
Copy link
Member

I'm not familiar with your review process, should I add reviewers myself or would it be picked up once PR is in?

Thank you! I will have a look.

@Jubintgh
Copy link

Thanks @suhaibmujahid, I have pushed the changes your requested, would appreciate if any of you guys could do a quick review:
@marco-c
@suhaibmujahid

#2365

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants