Skip to content

Workflow dispatch + dev branch tidy-up#882

Merged
shati-patel merged 6 commits intogithub:mainfrom
shati-patel:workflow-dispatch
Jun 23, 2021
Merged

Workflow dispatch + dev branch tidy-up#882
shati-patel merged 6 commits intogithub:mainfrom
shati-patel:workflow-dispatch

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel commented Jun 16, 2021

This branch is based on the qc-development branch, but (assuming the feature-flagging works) it should now be good to merge to main without disrupting our external users.

More details in internal linked issue and demo!

Checklist

(n/a—these features aren't useful to external users, so no need to publicize them)

  • [N/A] CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • [N/A] Issues have been created for any UI or other user-facing changes made by this pull request.
  • [N/A] @github/docs-content-codeql has been cc'd in all issues for UI or other user-facing changes made by this pull request.

@shati-patel shati-patel changed the title First pass at workflow dispatch Workflow dispatch + dev branch tidy-up Jun 17, 2021
@shati-patel shati-patel changed the base branch from qc-development to main June 17, 2021 11:35
@shati-patel shati-patel marked this pull request as ready for review June 17, 2021 11:42
@shati-patel shati-patel requested a review from aeisenberg June 17, 2021 11:42
{
"command": "codeQL.runRemoteQuery",
"when": "editorLangId == ql && resourceExtname == .ql"
"when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have you verified this is working correctly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, the commands are hidden in the right situations! Annoyingly, the authentication option itself is still visible from the side bar, even with the canary setting false...

image

That comes from the initialization step, which isn't feature-flagged.

const credentials = await Credentials.initialize(ctx);

Will have a look at tidying that up tomorrow! 🧹

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, the commands are hidden in the right situations!

Nice!

Annoyingly, the authentication option itself is still visible from the side bar, even with the canary setting false...

Hmmm...is it sufficient to wrap the call to Credentials.initialize in a check to see if canary is set?

Also, if someone changes from canary to not canary, it would be nice if they were logged out of github. You can set up a configuration listener and automatically log out if canary goes from true to false (similarly, you can automatically log in when the setting goes in the other direction).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also, if someone changes from canary to not canary, it would be nice if they were logged out of github. You can set up a configuration listener and automatically log out if canary goes from true to false (similarly, you can automatically log in when the setting goes in the other direction).

I did some more experimenting, and I don't know if it's possible to log a user out via the public authentication API if we're using a "built-in" AuthenticationProvider (i.e. GitHub or Microsoft)... I found a few comments where other people were also talking about the lack of a "logout" option and how the authentication providers are registered, so I think this might be a wider problem 🤔

For now, I've at least wrapped the call to Credentials.initialize in a canary check, so everything is fully hidden when it needs to be 🎉 Is that okay for now? I don't expect many users toggle the canary flag by accident, so it shouldn't have a noticeable impact!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh well. Thanks for looking into this and apologies for suggesting something that isn't possible.

It's not a big deal since if someone is already logged in and in canary mode, then they are already aware of this feature and will have tried to use it. And it's sufficient to just hide the feature if canary is off. I'll take another look shortly.

@shati-patel shati-patel requested a review from a team as a code owner June 17, 2021 20:26
@rneatherway
Copy link
Copy Markdown
Contributor

I've given this a run-through locally and it worked well ❤️. It prompted me to remove the default values for the parameters on the controller workflow as they would be silently used if entries were missing from the .repositories file, which was very confusing.

Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Looks good. One small suggestion, which you can take or leave.

@shati-patel shati-patel merged commit 06170f9 into github:main Jun 23, 2021
@shati-patel shati-patel deleted the workflow-dispatch branch June 23, 2021 08:14
aofaof0907 pushed a commit to aofaof0907/vscode-codeql that referenced this pull request Jul 27, 2021
Two new "canary" commands:
* GitHub authentication (from github#874)
* Workflow dispatch (run remote query)
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.

4 participants