cyber-dojo / commander

repo for the cyberdojo/commander Docker image and the cyber-dojo bash script

Home Page:https://cyber-dojo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`cyber-dojo start-point inspect exercises` doesn't work.

TBBle opened this issue · comments

paulh@PAULH-W7-PC2 MINGW64 ~/Documents/cyber-dojo
$ ./cyber-dojo start-point inspect exercises
./start_from ./start_point_inspect.rb:32:in `spacer't (ArgumentError)
        from ./start_point_inspect.rb:110:in `<main>'line'

The other two start points, languages and custom, work correctly.

This is with a cyber-dojo instance on Windows in Docker Toolbox, set up this afternoon, and just updated to verify:

$ ./cyber-dojo update
Using default tag: latest
latest: Pulling from cyberdojo/commander
Digest: sha256:fd48c187d55f1c49ae1df581cc5fd5d6856ce78cde130ba3825459f024d372cd
Status: Image is up to date for cyberdojo/commander:latest
latest: Pulling from cyberdojo/nginx
Digest: sha256:ed4463bd27332c214b612e39b6eabab48b066f60fbc4cef368b2c55dacf6f63a
Status: Image is up to date for cyberdojo/nginx:latest
latest: Pulling from cyberdojo/web
Digest: sha256:5ce94925a22c2740be249d26fa464f662b07580722d101bc68b056bd22527d94
Status: Image is up to date for cyberdojo/web:latest
latest: Pulling from cyberdojo/puller
Digest: sha256:82b75dbd2960c0074551804ef08125c10d6b709b44c11c2233f05b7962aa7a4e
Status: Image is up to date for cyberdojo/puller:latest
latest: Pulling from cyberdojo/runner
Digest: sha256:f5ca728497d2386bc52007127a69f7ea7d269cd86054f740f3d415a2566d57f6
Status: Image is up to date for cyberdojo/runner:latest
latest: Pulling from cyberdojo/storer
Digest: sha256:f62e7cf9f76e6493035276a3c1d1da716d84b7f5fc03a8ea53bb938fe578acee
Status: Image is up to date for cyberdojo/storer:latest
latest: Pulling from cyberdojo/differ
Digest: sha256:f32168e1205217df00ca03c26d66f6cb7913b2b8aa0179953a543023981fe33d
Status: Image is up to date for cyberdojo/differ:latest
latest: Pulling from cyberdojo/collector
Digest: sha256:f9203f4fc84b56bc6813ba98fe8c33f34108af02b0f543eae9a2ab56bb855144
Status: Image is up to date for cyberdojo/collector:latest
latest: Pulling from cyberdojo/zipper
Digest: sha256:ada8ba256ba042d482a70a0c784afada6ec779f34d55cbcb32d6f809426dd594
Status: Image is up to date for cyberdojo/zipper:latest

Just checking, the issue is

def spacer(longest, name)
  ' ' * (longest.size - name.size)
end

is being called with space(8, 10) and hence trying to return -2 spaces.

Worked it out, it's two issues:

  • Exercises don't have manifests.json so the manifests_hash doesn't see them
  • The defaults for $max_major, $max_minor, and $max_image are the sizes of the header lines, but should be the text of the header lines, as per the max_size function.

Hi. Hmmmm. I'm not sure it's even meaningful to do an inspection of the exercises. The exercises are completely different to the custom volume and the languages volume. They both have details relating to their docker images. Exercises are not associated with docker images at all. Just with a text file always called instructions. I suppose it could produce something but it would be of a different format. What do you think?

That makes sense to me. I was just using inspect so I could get a list of exercises available to paste into a chat channel. I can't see any wider need than that.

I've implemented exactly that. If you do [cyber-dojo update] you should be good to go :-)
If you're happy with this I'll close this issue. Thanks again.

The incorrect default values for $max_major, $max_minor, and $max_image are still in start_point_inspect.rb. I hit this failure case again when SELinux complications meant I ended up with an empty "languages" start-port.

Edit: The ./cyber-dojo start-point inspect exercises output looks fine now.

You are right. Fixed that too.

Looks good to me.