OpenAstronomy/baldrick

Bug in config infrastructure

Opened this issue · 7 comments

I haven't had a chance to investigate yet, but there is an issue with the following calls, e.g.:

    mc_config = pr_handler.get_config_value("milestones", {})

Basically this looks like it tries to get the config from the master branch of the repository, but we need to get it from the pull request since we want e.g. changes in config in pull requests to be tested immediately.

fwiw, it's very explicitly reading the config from the master branch for the circleci checker, or else anyone who opens a PR can control the statuses on that PR. I assume this is also true for the changelog checker. Perhaps it should only read the config from the PR branch if that person has merge rights?

Yeah, I think we do need to have a way for it to work from the PR head as sometimes it helps fix the config if needed, but I see your point. I wonder if the GitHub API includes information about commit rights in the JSON for a PR - like the fact it says 'Member' for both of us on our comments here.

It could also be a combination of who opened the PR and if a label is present

👍 for doing this if possible using a combination of "white listed" accounts (who control the bot) in addition to a label (that is controlled by repo maintainers).

Actually why not just a label to enable it? People who can add labels have to have sufficient rights on github.

Yes, good point!

pllim commented

Is this what you mean by the bug?

RuntimeError: Working outside of application context.