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

(URGENT) isodoc requiring sassc in normal execution, and metanorma-* gems should not be published without compiled CSS #367

Open
2 tasks
ronaldtse opened this issue Jan 9, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Contributor

ronaldtse commented Jan 9, 2022

This is a regression. When generating the https://github.com/metanorma/iso-19626-1 document:

https://github.com/metanorma/iso-19626-1/pull/8

$ bundle exec metanorma site generate
...
#<Thread:0x00000001316cde00 /Users/me/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/metanorma-1.4.4/lib/metanorma/worker_pool.rb:7 run> terminated with exception (report_on_exception is true):
/Users/me/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:78:in `require': cannot load such file -- sassc (LoadError)
	from /Users/me/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:78:in `convert_scss'
	from /Users/me/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:100:in `generate_css'

This task is to:

  • Make sure metanorma-* gems when released, they always have the compiled CSS files, through an automated gem validation mechanism.
  • Maybe there should be a spec that tests against that to ensure that if the metanorma-* gem does not have compiled CSS included, the tests will fail.
@ronaldtse ronaldtse added the bug Something isn't working label Jan 9, 2022
@ronaldtse ronaldtse moved this to Triage in Metanorma Jan 9, 2022
@ronaldtse ronaldtse moved this from Triage to Urgent in Metanorma Jan 9, 2022
@ronaldtse
Copy link
Contributor Author

And this is also visible here (metanorma/packed-mn#126, run: https://github.com/metanorma/packed-mn/runs/4750539224?check_suite_focus=true) .

Looks like this is metanorma-iso specific, e.g. metanorma-iso lost the compiled CSS file.

#<Thread:0x00007f53bc5924e8 /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/metanorma-1.4.4/lib/metanorma/worker_pool.rb:7 run> terminated with exception (report_on_exception is true):
177
/__tebako_memfs__/lib/ruby/gems/2.7.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:78:in `require': cannot load such file -- sassc (LoadError)
178
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:78:in `convert_scss'
179
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:100:in `generate_css'
180
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/isodoc-1.8.4/lib/isodoc/css.rb:28:in `populate_css'
181
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/isodoc-1.8.4/lib/isodoc/html_function/html.rb:12:in `block (2 levels) in convert1'
182
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/xml/builder.rb:433:in `insert'
183
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/xml/builder.rb:416:in `method_missing'
184
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/isodoc-1.8.4/lib/isodoc/html_function/html.rb:10:in `block in convert1'
185
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/xml/builder.rb:334:in `initialize'
186
	from /__tebako_memfs__/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/xml/builder.rb:292:in `new'
187

@CAMOBAP
Copy link
Contributor

CAMOBAP commented Jan 9, 2022

[email protected] release failed because of this, for some reason it happens only for iso flavor

@ronaldtse
Copy link
Contributor Author

This was merged here: metanorma/metanorma-docker#124

@opoudjis
Copy link
Contributor

metanorma-iso-1.10.6 does not appear to have the CSS compiled. metanorma-iso-2.0.0 does, but it will only be accessible once I've released metanorma-cli, since this is a major version update. Issue will go away then.

@ronaldtse
Copy link
Contributor Author

metanorma-iso-1.10.6 does not appear to have the CSS compiled

This is a major bug. How did that happen? I think we need some guard task to prevent this from happening.

@opoudjis
Copy link
Contributor

I do not know. And please delegate any such task to someone else. The isodoc gem does in fact contain such code:

rule ".css" => [proc { |tn| tn.sub(/\.css$/, ".scss") }] do |current_task|
        puts(current_task)
        compile_scss_task(current_task)
      rescue StandardError => e
        notify_borken_compilation(e, current_task)
      end

....

   def notify_borken_compilation(error, current_task)
      puts("Cannot compile #{current_task} because of #{error.message}")
      puts("continue anyway[y|n]?")
      answer = STDIN.gets.strip
      if %w[y yes].include?(answer.strip.downcase)
        puts("Cannot compile #{current_task} because of #{error.message}")
      else
        exit(0)
      end
    end

Execution should have aborted during the release. I do not know why release was successful.

@opoudjis
Copy link
Contributor

Confirmed that this has gone away with new release.

I request that someone who knows ruby rails better than me (which is not at all) author the guard task, and I am unassigning myself.

@opoudjis opoudjis assigned ronaldtse and unassigned opoudjis Jan 13, 2022
@ronaldtse
Copy link
Contributor Author

Got it. Shouldn't Let me re-tool this task to do so.

@ronaldtse ronaldtse changed the title (URGENT) isodoc requiring sassc in normal execution (URGENT) isodoc requiring sassc in normal execution (metanorma-* gems should not be published without compiled CSS) Jan 14, 2022
@ronaldtse ronaldtse changed the title (URGENT) isodoc requiring sassc in normal execution (metanorma-* gems should not be published without compiled CSS) (URGENT) isodoc requiring sassc in normal execution, and metanorma-* gems should not be published without compiled CSS Jan 14, 2022
@webdev778
Copy link

If this has been added recently:

https://github.com/metanorma/metanorma-build-scripts/blob/main/.github/workflows/rubygems-release.yml

Then maybe it doesn't have a build step for scss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🌋 Urgent
Development

No branches or pull requests

4 participants