paclets / PacletServer

A paclet server for Mathematica
https://paclets.github.io/PacletServer/
29 stars 8 forks source link

Register paclet: MeshTools #40

Closed PintarM closed 5 years ago

PintarM commented 5 years ago

This is my paclet with functions for structured ElementMesh generation: https://github.com/c3m-labs/MeshTools

MeshTools-0.3.1.zip

I am using this method for submitting the paclet, because registering it via "PublicPacletServer" didn't work for me. I think it had something to do with authentication.

b3m2a1 commented 5 years ago

Merged. Can you tell me more about the authentication issue?

PintarM commented 5 years ago

When I evaluate the following code, a nice authentication dialog pops up, I enter my credentials for GitHub but then I get message from Which and lots of unevaluated code returned.

PublicPacletServer[
 "RegisterPaclet",
 <|
  "Name" -> "MeshTools",
  "Author" -> "PintarM",
  "URL" -> "https://github.com/c3m-labs/MeshTools",
  "Update" -> "DownloadOnce"
  |>
 ]

Please see attached zipped notebook about this procedure. PacletServer.zip

b3m2a1 commented 5 years ago

Ah shoot. I forgot to expunge a line from the Which call. That should be fixed in the most recent paclet update. Odd I didn't run into it, but that happens. I think the version of BTools may not have been updated, as I forgot to use the "Update" option in my dependency loading code. Try the newest paclet version with PublicPacletServer["RequestPacletUpdate", "MeshTools"]. It ought to just put a comment on this thread that we can delete after the fact. To load the update you'll likely need to run PublicPacletServer`PackageScope`Private`$LoadCompleted=False first. Or better yet, run <<BTools`Developer`; ContextRemove["PublicPacletServer`"]

PintarM commented 5 years ago

I updated the PublicPacletServer to 0.0.7. When I run PublicPacletServer["RequestPacletUpdate", "MeshTools"] I get output $Failed and message PublicPacletServer::badhub .

b3m2a1 commented 5 years ago

Well at least that's something... I think the issue is that my return format for the GitHub call (that "ResultObject") is a newer format that wasn't in the version of my GitHub connection that had been loaded previously.

To check if you're on the most recent library version you can run:

PacletFind["BTools"][[1]]["Version"]

"2.1.30"

If you are, then I think the updates probably have loaded.

If you've restarted the kernel at any time since submitting this, you can just try the request again and let me know if it worked, but if not could you try to do something before I debug more? If you could run

<< BTools` 
BTools["Get", "External/Git/GitHub"]

then try the request again. Or if that does nothing to help, try:

ContextRemove["PublicPacletServer `"];
ContextRemove["BTools `"]

then reload and try again?

If the issue really is that the core library hasn't updated one of those would fix it. If it is up to date then I have to debug more.

PintarM commented 5 years ago

I have followed your instructions, but unfortunately PublicPacletServer["RequestPacletUpdate", "MeshTools"] still doesn't work and returns Failure["GitHub: CreateIssueComment (401)", <|"StatusCode" -> 401, "Message" -> "Bad credentials", "Command" -> "CreateIssueComment"|>]. My installed "BTools" paclet is updated to 2.1.30 and I think I run your suggested workarounds correctly.

I have tried also with PublicPacletServer["RegisterPaclet", "MeshTools"], but this returns $Failed with message PublicPacletServer::noauth.

What I found unusual is that I have to authenticate twice to two different pop-up dialogs. Is this expected?

I am sorry that I always come back with bad news. :)

b3m2a1 commented 5 years ago

The two different dialogs indicate something went wrong. The first one is mine, which appears to not be taking your credentials properly. The second one is WRI's which has never worked for me and likely never will.

The credentials I should be using are stored in BTools`External`Git`$GitHubPassword and BTools`External`Git`$GitHubUsername. Let me know if these have been stored correctly. If not try BTools`External`GitHub["ClearPassword"] and then hopefully the authentication will work after you add new credentials.

If they're still wrong after that means something's gone wrong in the mechanism I have for storing credentials and I'll have to run tests on that code path to figure out what. Odd that it seems only to be hitting you, but I'll figure it out.

PintarM commented 5 years ago

I think I have found cause of the problem and it is slightly embarrassing... "MeshTools" repository is hosted on organization account "c3m-labs", where I am one of the owners. It seems to me that I can only login to GitHub with user account and not with organization account and I didn't realize that. So essentially my credentials were wrong.

One possible workaround for this is that I submit paclet from my personal fork of repository? (But this may be confusing, because then there will exist two separate "MeshTools" releases?)

Do you have any ideas how to solve this issue with organization accounts?

b3m2a1 commented 5 years ago

Ahhh. Of course. I see the issue now. I don't think organizations can open issues and comment and things. I'm pretty sure it's only users, so you'll need to use a standard user account.

PintarM commented 5 years ago

Paclet has been updated. Merge of new version requested.

PintarM commented 5 years ago

It works! My previous comment above has been automatically generated from Mathematica. Sorry about all this trouble.