Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the dependencies before starting the server #583

Closed
karlcow opened this issue Mar 9, 2015 · 7 comments
Closed

Check the dependencies before starting the server #583

karlcow opened this issue Mar 9, 2015 · 7 comments

Comments

@karlcow
Copy link
Member

karlcow commented Mar 9, 2015

Sometimes we change the modules, etc. For example,

-WTForms==1.0.5
+WTForms==2.0.2

I wonder if we should add a checker before run. Where we would get a pseudo UI like:

python run.py

** You need first to update your python/js before starting webcompat.com
@@Instructions to do so@@

On the python side, probably something with pip install --no-install
or making a diff in between libraries installed and the ones in requirements.txt

For JavaScript, I don't know how it is checked.
Also when do you need to run again grunt.

@karlcow
Copy link
Member Author

karlcow commented Mar 9, 2015

See also in #581
do not forget to do : npm install cc @karlcow @tagawa @calexity

@tagawa
Copy link
Member

tagawa commented Mar 9, 2015

+1

@miketaylr
Copy link
Member

For JavaScript, I don't know how it is checked.

I don't think starting the application server should know or care about build-time (which is all we use npm/grunt for) dependencies. For our app, Flask just wants to serve static assets. If we do anything for that, it should happen at the make/grunt level (which compiles/minifies those).

Also when do you need to run again grunt.

You could write a grunt task for this, there might even be a module out there already. As for when to run grunt, just run grunt watch or make watch while developing. No need to re-run it.

e0a4aa6 is a simple take on pip dependencies, using a difference set.

@miketaylr
Copy link
Member

Here we go: https://www.npmjs.com/package/grunt-check-dependencies. Let's open a new bug for that.

@miketaylr
Copy link
Member

cf #587.

@karlcow
Copy link
Member Author

karlcow commented Mar 9, 2015

I don't think starting the application server should know or care about build-time (which is all we use npm/grunt for) dependencies.

Note that it is about discovering that there is something missing or that we need to rerun. Think about it as deploying locally for running. So indeed it is possible it's not the right place. No issue with that. It might be good to put it at another place. Maybe I should just create an alias for myself which does it. Or create my own script which doesn't impact the project.

grunt watch

It doesn't do what I want.

(webcompatcom)08:32:03 ~/code/webcompat.com
→ grunt watch
Running "watch" task
Waiting...

Still waiting. Not sure what it does.

It doesn't tell me that something has changed and I should run something. It has happened already more than 3 times, that I just type make and it recompiles and installs everything with a nice blank config.py. Yes I'm a bit dumb 👹 And I'm trying to usually put destroying actions behind flags and have the default being more secure.

I will find a solution.

@miketaylr
Copy link
Member

It doesn't do what I want.

@karlcow what do you want it to do? I think I got confused by your description of having to re-run grunt.

We use grunt to do a few things, the only really useful thing for development/local server is re-compiling the CSS and running jshint. That's what grunt watch is for. When it says "Waiting...", it's watching for local changes to CSS files. As soon as it detects one, it will re-run the cssnext task (which concatenates the development CSS). If there was a change in JS, it runs jshint, etc.

It doesn't tell me that something has changed and I should run something.

#587 will fix that, I'll take a stab at that today or tomorrow.

miketaylr pushed a commit that referenced this issue Mar 25, 2015
Fix the dependencies checking. Fix #583
miketaylr pushed a commit that referenced this issue Jul 20, 2015
… karlcow-583/2

* '583/2' of https://github.com/karlcow/webcompat.com:
  Fix #583 Using the function for checking dependencies
  Checking dependencies
  Modules needed for checking dependencies
  Two cases to handle
  Adding message
miketaylr pushed a commit that referenced this issue Jul 20, 2015
* master: (46 commits)
  Fixes #509 - mention [ci skip] in docs.
  v1.6.2 changelog
  Issues #588 - list style
  Fix #583 Using the function for checking dependencies
  Checking dependencies
  Modules needed for checking dependencies
  Two cases to handle
  Adding message
  Issue #368 - Remove (now) unused STARTUP variable
  Issue #368 - Compute cache busting param based on md5 hash of file
  Issue #368 - Move bust_cache function into a Jinja template helper
  Issue #368: Part 1, add bust_cache param to minified production JS
  Issue #587 - Add a task to check npm dependencies and run by default
  v1.6.1
  Fixes #591 - Typo in form field. >_<
  Tag v1.6.0
  Issue #572 - Remove right float for GitHub issue warp hint
  Issue #432 - Add js-form-error and js-no-error classes and update tests.
  Issue #432 - Add wc-Form-required class to problem label
  Added wc-Form, wc-ReportForm
  ...
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

No branches or pull requests

3 participants