GithubHelp home page GithubHelp logo

cyber-dojo / web Goto Github PK

View Code? Open in Web Editor NEW
72.0 9.0 21.0 81.21 MB

repo for the cyberdojo/web Docker image; a cyber-dojo microservice

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

License: BSD 2-Clause "Simplified" License

Ruby 13.37% JavaScript 52.08% CSS 0.61% Shell 4.04% HTML 15.40% Dockerfile 0.08% SCSS 13.53% HCL 0.88%
kata tdd individual-practice team-practice

web's Introduction

web's People

Contributors

aga303 avatar byran avatar byran-wills-heath-bluefruit avatar cadnce avatar diegopego avatar emilybache avatar fayesgw avatar isidore avatar jhannes avatar jlehtnie avatar jonjagger avatar jooyunghan avatar jwgrenning avatar kkujala avatar klaas1979 avatar mbirtwell avatar meekrosoft avatar meshell avatar michelgrootjans avatar mob-programming-meetup-austria avatar nablaa avatar olafleur avatar philsquared avatar rchatley avatar sleepyfox avatar stevenacoffman avatar vishalmadhvani avatar xpmatteo avatar zhelezovartem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web's Issues

New C# exercise using nunit fails on initial test run

I tried a couple of different exercises and was getting the same error each time on initial test run. All are using c# with nunit:

'/nunit/NUnit.2.6.2/lib' in MONO_PATH doesn't exist or has wrong permissions.
Compilation failed: 1 error(s), 0 warnings
error CS0006: Metadata file `/nunit/NUnit.2.6.2/lib/nunit.framework.dll' could not be found

warning: circular argument reference - now

When you run the app_controllers test you get this warning
/usr/lib/ruby/gems/2.3.0/gems/activesupport-4.1.0/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now

Upgrading to Rails 4.2.6 gets rid of the 'now' warning.
But it introduces deprecation warnings and breaks some of my routes...
Should be an easy job for someone with good rails knowledge.

ServiceError in KataController

Hi,

I had a link that I saved from a previous session from couple days ago (https://www.cyber-dojo.org/kata/edit/VEQ6v6R2bh?avatar=bear), and now when I click the link, I receive the following error:

ServiceError in KataController#edit
{ "path": "kata_events", "body": "{\"id\":\"VEQ6v6R2bh\"}", "class": "SaverService", "message": "malformed:id:size==10 -> !6:", "backtrace": [ "/app/src/well_formed_args.rb:336:in `malformed'", "/app/src/well_formed_args.rb:188:in `well_formed_id'", "/app/src/well_formed_args.rb:58:in `id'", "/app/src/rack_dispatcher.rb:96:in `public_send'", "/app/src/rack_dispatcher.rb:96:in `block (2 levels) in well_formed_args'", "/app/src/rack_dispatcher.rb:55:in `validated_name_args'", "/app/src/rack_dispatcher.rb:16:in `call'", "/app/src/prometheus/exporter.rb:32:in `call'", "/app/src/prometheus/collector.rb:33:in `block in call'", "/app/src/prometheus/collector.rb:73:in `trace'", "/app/src/prometheus/collector.rb:33:in `call'", "/usr/lib/ruby/gems/2.4.0/gems/rack-2.0.6/lib/rack/deflater.rb:34:in `call'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb:86:in `block in pre_process'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb:84:in `catch'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb:84:in `pre_process'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb:53:in `process'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/connection.rb:39:in `receive_data'", "/usr/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'", "/usr/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/backends/base.rb:73:in `start'", "/usr/lib/ruby/gems/2.4.0/gems/thin-1.7.2/lib/thin/server.rb:162:in `start'", "/usr/lib/ruby/gems/2.4.0/gems/rack-2.0.6/lib/rack/handler/thin.rb:22:in `run'", "/usr/lib/ruby/gems/2.4.0/gems/rack-2.0.6/lib/rack/server.rb:297:in `start'", "/usr/lib/ruby/gems/2.4.0/gems/rack-2.0.6/lib/rack/server.rb:148:in `start'", "/usr/lib/ruby/gems/2.4.0/gems/rack-2.0.6/bin/rackup:4:in `<top (required)>'", "/usr/bin/rackup:23:in `load'", "/usr/bin/rackup:23:in `<top (required)>'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'", "/usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'", "/usr/bin/bundle:23:in `load'", "/usr/bin/bundle:23:in `<main>'" ] }

screen shot 2018-12-11 at 1 44 51 pm

How could I recover the previous session that I had?

Thanks

cyber-dojo.org doesn't work in Safari because of keyword `let`

Function cyberDojo contains the word let, which isn't supported on Safari.
https://stackoverflow.com/questions/34636737/unexpected-use-of-reserved-word-let-in-strict-mode

The visible symptom is that if you visit http://cyber-dojo.org in Safari, the whole page loads, but none of the hyperlinks work. I click them, and nothing happens. (I assume this is because the Javascript that's supposed to hook them up to actions has not been run because of the above syntax error.)

Is it possible to use the word var instead of let (for example)?

better filename ordering

Put instructions file in lower section with cyber-dojo.sh etc.

Put dot files at the bottom of the upper section (eg .jshintrc)

kata resurrection is in the wrong place

It should be handled (and tested) inside the runner_stateful service itself.
When this is done a bunch of the slowest web tests (app_controllers) can be deleted.

reduce size of web image

The test folder is ~45MB
Do not include this in the web image. Instead, mount it as a volume
when running the tests inside the web container.
This would bring the web image down to 230MB from 275MB.

filename dialog improvements?

When typing in a filename the characters backslash and space are not allowed (space is allowed at the start and is ignored). That is, they appear on the filename but the [ok] button is disabled.
Would it be better if they were filtered out as they were pressed, viz they did not appear in the filename at all?

Note that text files can be created inside the container and round-trip back to the browser.
These files can have any legal Linux filename. Viz use any character except /
This means there is a difference between filenames you can use like this and filenames you can create directly in the browser.

reinstate Approval style test frameworks

Approval style tests are currently off-line because they require post-run .txt file retrieval.
See the cyber-dojo/languages-offline repo.
Now that runner is a separate service this would be a reasonable amount of work.

reduce size of language+test images

Make some smaller alpine-linux language images.
Specifically, C#-NUnit and Java-JUnit

Java
frolvlad/alpine-oraclejdk8:slim
How big is it? ~166.9 MB (vs 843.7 MB)
docker run --rm frolvlad/alpine-oraclejdk8:slim sh -c "javac -version"
javac 1.8.0_92
There is an alpine package called junit (branch=edge, repo=testing)

Put Alpine based small images into cyberdojo repo (rather than cyberdojofoundation) ?

converge all avatars to same set of files

Typically, when doing a longer dojo with a large group (eg in a themed tutorial day) the amount of progress the avatars make varies. It would be nice, periodically, to be able to 'converge' all the avatars to the files in a traffic-light carefully chosen from one of the avatars. Then get everyone to refresh their browsers and they would all be at the same point.
This is different to forking a new dojo (which you can already do). This means the files-set for the chosen traffic-light is sent to the storer as if each avatar had submitted it.
This feature feels like it would live on the diff, together with the fork/revert buttons.

optional extra info on setup page entries

If there's extra info, make the entries in the minor colum (eg "tests?") be links that display the info text in a popup box when hovered over.

If there's no extra info, then simply render them as plain text - no hover functionality.

generated text files have small height-width (and are resizable)

If you append this line to cyber-dojo.sh
echo 'xxx' > small.file
and then press the [test] button
then small.file successfully round-trips back to the browser but...
o) its width-height appearance is very small.
o) it is resizeable! This is quite a find since I thought that was impossible!
o) it does not have line-numbers

Note this behaviour is not present on the live on cyber-dojo.org
You need to create a local server using the latest web service to replicate it.

on kata/edit should clicking avatar icon open a dashboard page?

  1. It is not obvious behaviour
  2. It is not really useful behaviour if you are practising on your own and there are no other avatars.
    I think it would be better if the clicking the avatar did nothing and there was a [dashboard] button on the footer-bar if there were 2+ active avatars in the kata. This state could be updated on each test event.

search and replace

The ability (in javascript) to do a simple search and replace on visible files.
Initially this can be very simple, with no regex, allowing a simple identifier renaming.

better diffs

git 2.9+ has new --compaction-heuristic for improved diffs.
I would like to use this.
See https://github.com/JonJagger/differ
Alpine-linux has a package for 2.10+ (branch=edge, repo=main)
Git version in web image is 2.8.3

"clean up" the license

while you state that cyber-dojo is open source you don't mention under which license. (BSD? MIT? GPL 2? GPL 3?)

in my opinion, the license.md file on github should only mention the license for the code.
the license for using the server, should be on the server itself, and -- if i understand your purpose correctly -- does not matter for the people using your code or contributing to it.

the link to the usage terms of the server could be in the readme file, instead.

i can help you picking a license and publishing it, if you think you need more information on the topic.

keep up the great work!

Adding libraries and functionality to cyber-dojo python

Can we please import "certain third party" libraries in python cyber-dojo instance?

Either by:

  1. If you would offer the creator of a Session or users to use perhaps their own locally install python libraries on their local machine, it would be nice.
    OR
  2. Or perhaps by default install the major libraries for Python for all of cyber-dojo. For example, I have talked to every python user that is a member of Technology Association of Georgia, they personally would like to import libraries like scipy, numpy, dateutil (or any basic date read), and panda (or any basic data structure maker) in order to teach python better.
    OR
  3. A library import function that will literally crawls on github code repository, then copies, and pastes everything into your particular cyber-dojo session. It does not execute the code, it just copy/pastes very code file.

We don't even need the fancy stuff like Tensorflow, Theano, scikit-learn, or ntlk. Just the very basic functionality creating vectors, etc. Python is not Python without Numpy and the other major libraries.
I know security can be issue, but we really need more basic libraries in order teach what makes python unique and better than other languages like java. This is why I suggested 3 possible solutions instead of just one.

fold long lines in output window

At the moment they don't fold and hence you have to scroll to the right to read the whole line.
Ideally, the line-numbers will adjust accordingly as well. At the very least reduce font-size.

Add option to toggle line-numbers

Currently when you click on the line-numbers column they toggle on/off.
Remove that.
Instead add a line-number toggle to the options dialog (only on kata/edit page).

slightly off CSS for selected filename

On the kata/edit page if you select a file from the filelist, eg cyber-dojo.sh, using the mouse cursor, then it gets set to the correct 'selected' colour.
If you then move away from that file using the Alt-K hotkey, the instructions filename does not get set back to the 'unselected' colour.

Update: After Alt-K the hand-cursor is invisible until you move the cursor again, at which point the CSS colour goes back to normal. The CSS that does this is

  &:hover { color: lighten($darker-color, 60); }

in app/assets/stylesheets/wide-list-item.scss

Decided to simplify things by removing that fragment of CSS.

download into a tgz file holding git repos

Currently, the download button from the dashboard page gives you a tgz file which untars to a set of manifest.json files, one per avatar+traffic-light. This is the format used in the storer service and so is useful for admins moving dojos from one server to another.
A more useful format for the avatars would be to download a tgz file which untars to a set of git repositories, one per avatar. Add a second download button for this.

warning: tilt autoloading 'sass'

The app_controller tests are issuing a warning
WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.
How to fix this?

generated/changed empty text file is not round-tripping back to the browser

If cyber-dojo.sh does this
touch empty.file
Then this is not round-tripping back to the browser.
This is because @new_files is [] in kata_controller.rb
Similarly if instructions is an existing file and cyber-dojo.sh does this
rm instructions
touch instructions
Then again, instructions is not round-tripped back to the browser.

up.sh script assumes [cyber-dojo] is on path and loads default start-points

the up.sh script does this
$ cyber-dojo down
$ cyber-dojo up
This assumes the cyber-dojo script is on the path and it might not be.
Also, if you are running this on a host which has customized the default start-points then the customed start-points will be loaded. One possible fix is to...
o) create 3 customized start points from the 3 github repos and use uuidgen to name them (git pulls will require network access)
o) replace [cyber-dojo up] with [cyber-dojo up --languages=X1 --exercises=X2 --custom=X3]
where X1,X2,X3 are the uuidgen'd names.
o) when the tests finish do [cyber-dojo start-point rm] on each of X1,X2,X3

files changed by test run are not yet round-tripped back to the browser

new-files and deleted-files are round-tripped back to the browser. But changed-files are not.
For example, ruby-minitest has simple statement coverage which creates a file coverage/.last_run.json
This file is not updated in the browser and so always contains the results of the first test run.

Simplify handling of output file

app/view/kata/_visible_files.html.erb handles the filename called output specially.
And so does app/controller/kata_controller.rb
It would probably simplify the code if output was treated as just another file, possibly with a touch of javascript to control attributes such as the textarea wrap.

allow avatars to have subdirectories

BDD style frameworks, for example, want to have a certain directory structure involving a directory called feature.
At the moment an avatars files are all in a single directory.

new/rename file is not in colour if colour-syntax is switched on

cd.toggleSyntaxHighlight = () => { ... };

is at the top of /app/assets/javascript/cyber-dojo_codemirror.js
This uses two helper functions disableSyntaxHighlight and enableSyntaxHighlight.
So enableSyntaxHighlight needs to be run when a new/rename file operation takes place, as long as syntaxHighlightEnabled() is true

show session info on dashboard

Add the display_name, exercise_name to the dashboard on the LHS.
Use the same format as the options dialog (from the footer bar).
Useful if you have several language sessions going at the same time.

pulling an image when setting up a practice session fails

I think the underlying [docker pull] is taking longer than a default timeout.
Particularly when pulling a non Alpine image. If you wait a while and do a [docker images] on the server then the image has been pulled, and if you do another identical setup its fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.