These are chat archives for opf/openproject

14th
Jul 2015
jankap
@jankap
Jul 14 2015 08:47
Hey guys. Can you estimate the time and affort to include a markdown syntax interpreter in openproject? How deeply is textile involved? Redmine hast included markdown via the redcarpet gem. Is there a chance to get this included?
Alex Coles
@myabc
Jul 14 2015 10:27
@jankap it’d be a lot of work.
jankap
@jankap
Jul 14 2015 10:31
okay thank you
Alex Coles
@myabc
Jul 14 2015 10:33
@jankap the problem is that Textile is hard-coded in a lot of places. A robust solution would require a complete refactor of text rendering to use something like GitHub’s HTML::Pipeline https://github.com/jch/html-pipeline
Florian Kraft
@floriank
Jul 14 2015 10:51
there also would probably a migration problem, wouldn't it?
ulferts
@ulferts
Jul 14 2015 10:53
@floriank, @jankap yes, but one could get around this by either storing the "enconding" (textile/markdown) with a string or leave it to the user to choose upon initial installation
Florian Kraft
@floriank
Jul 14 2015 10:55
yeah, i know - i think the markdown feature is a long term goal iirc
Oliver Günther
@oliverguenther
Jul 14 2015 10:56
And on the wish list for a number of users https://community.openproject.org/work_packages/3760
Florian Kraft
@floriank
Jul 14 2015 10:57
count myself in, i always get the two mixed up between OpenProject and Github :)
Alex Coles
@myabc
Jul 14 2015 10:57
Pandoc can handle conversion.
Oliver Günther
@oliverguenther
Jul 14 2015 10:58
If there's no deviation from the standard, Pandoc works fine (Though I've only used it for RST -> md)
which included quite a bit of effort due to the way rst handles custom directives
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 11:06

I am current trying a first-time setup of my tests for PSQL, does anyone know the following error?

ActiveRecord::StatementInvalid: PG::UndefinedObject: ERROR: type "binary" does not exist
LINE 1: ...id" integer NOT NULL, "author_id" integer, "data" binary, "c...

ulferts
@ulferts
Jul 14 2015 11:07
@NobodysNightmare what's the migration?
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 11:09

Admittedly, I am not sure. I can see

CREATE TABLE "wiki_content_versions"

Oliver Günther
@oliverguenther
Jul 14 2015 11:09
It's in 000
792 t.binary 'data', limit: 16.megabytes
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 11:10
I am apparently doing something stupid... Just don't know what it is...
Oliver Günther
@oliverguenther
Jul 14 2015 11:10
but this is an error coming from postgres, thus the type binary wasn't properly translated to postgres type (probably bytea)
ulferts
@ulferts
Jul 14 2015 11:11
@NobodysNightmare what version of postgresql are you running?
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 11:13
psql (PostgreSQL) 9.4.4
ulferts
@ulferts
Jul 14 2015 11:16
@NobodysNightmare hm, just tried it with a new DB and works for me. I am also on 9.4.4
Oliver Günther
@oliverguenther
Jul 14 2015 11:16
I also run on 9-2 - 9.4 depending on my VM, didn't encounter this error before
but http://api.rubyonrails.org/v3.2.22/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html should have translated :binary to the Postgres BLOB type bytea
Can you set config.active_record.schema_format = :sql and check the output of db:schema dump whether the type is translated there?
ulferts
@ulferts
Jul 14 2015 11:20
@NobodysNightmare - @oliverguenther should be on the right track as the correct statement (from my logs) is:
CREATE TABLE "wiki_content_versions" ("id" serial primary key, "wiki_content_id" integer NOT NULL, "page_id" integer NOT NULL, "author_id" integer, "data" bytea, "compression" character varying(6) DEFAULT '', "comments" character varying(255) DEFAULT '', "updated_on" timestamp NOT NULL, "version" integer NOT NULL)
Oliver Günther
@oliverguenther
Jul 14 2015 11:23
okay :sql seems to be deprecated, my bad. But rake db:structure:dump should output a db/structure.sql
And that correctly outputs CREATE TABLE wiki_content_versions ( [... snip ...] data bytea,) (l. 2363ff.)
but it can't really be a cache error if you used MySQL before. iirc, MySQL uses blob as a binary type
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 11:29
dropped and recreated and now getting different errors...
I'll come back when there is order in the chaos, thanks for your help ^^
ulferts
@ulferts
Jul 14 2015 11:29
@NobodysNightmare whatever you are doing ... you will get there
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 11:46
Okay. The schema.rb will be used by your tests and thhis one is seeded from your development environment. That is why the dev environment has to be PSQL too
otherwise things happen, see above ^^
Sad thing that the schema.rb is not DB agnostic...
Oliver Günther
@oliverguenther
Jul 14 2015 12:03
why exactly is it not agnostic?
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 12:04
My reasoning is: I need to rebuild it for my test setup to work...
My conclusion from that observation is that it is not agnostic. I did not diff it (yet)
ulferts
@ulferts
Jul 14 2015 12:13
@NobodysNightmare this is hard to compare as the run for schema.rb contained plugins
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 12:14
I thought both were fresh, sorry...
Oliver Günther
@oliverguenther
Jul 14 2015 12:14
but on first glance, I see no differences in column types (at least), not sure if the differences in nullable attributes is also caused by plugins
On an unrelated note: Why does codecov want r/w access to my private repositories when browing a PR? :imp:
Florian Kraft
@floriank
Jul 14 2015 12:15
nothing to see here, move along :shipit:
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 12:58
@myabc I remember that you pointed to the rules for naming CSS classes once, can oyu point me there again?
aaaaand I already found it by remembering it was form hagenburger... http://www.hagenburger.net/BLOG/Modular-CSS-Class-Names.html
Oliver Günther
@oliverguenther
Jul 14 2015 13:10
Can I rollback a specific set of migrations (e.g., from a plugin) ?
ulferts
@ulferts
Jul 14 2015 13:12
@oliverguenther one of those should help you out I think: http://makandracards.com/makandra/845-migrate-or-revert-only-some-migrations
However, I think it will be hard to roll back a specific set conveniently
Alex Coles
@myabc
Jul 14 2015 13:17
@NobodysNightmare yep, that’s it. Methodology is BEM, with some modifications (modifiers use a shortened form, beginning with -)
Oliver Günther
@oliverguenther
Jul 14 2015 13:20
@myabc Thanks btw. for glancing into that PR and linking that article, I would have overlooked that approach browsing the sass itself.
Oliver Günther
@oliverguenther
Jul 14 2015 13:29
@ulferts I believed I could either migrate to a specific version or count the number of migrations installed by the plugin, but both raise the IrreversibleMigration from HideMailByDefault, even though it wasn't touched
ulferts
@ulferts
Jul 14 2015 13:30
BTW @NobodysNightmare why is that migration irreversible?
Oliver Günther
@oliverguenther
Jul 14 2015 13:31
I guess I need to write a git command to associate a certain database name with a branch, so that I can checkout my branch and continue work on a plugin without resetting my dev so often.
ulferts
@ulferts
Jul 14 2015 13:32
@oliverguenther the dirty way: move the offending migration from the folder, do what you want, move it back
Oliver Günther
@oliverguenther
Jul 14 2015 13:33
Yeah, that should totally speed up the workaround :D
ulferts
@ulferts
Jul 14 2015 13:53
Oliver Günther
@oliverguenther
Jul 14 2015 13:56
My fault, it isn't irreversible here either. The rake error must originate from somewhere else. Although I do get
==  HideMailByDefault: reverting ==============================================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
My fault, it isn't irreversible here either. The rake error must originate from somewhere else. Although I do get
==  HideMailByDefault: reverting ==============================================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
ActiveRecord::IrreversibleMigration
(thus I suspected without checking it was HideMailByDefault)
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 13:59
Sorry, did not see you were mentioning me
ulferts
@ulferts
Jul 14 2015 13:59
Never mind @NobodysNightmare, outdated already
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 13:59
Should I have written it as up/down migration?
ulferts
@ulferts
Jul 14 2015 14:00
No change is the modern way to do it
Oliver Günther
@oliverguenther
Jul 14 2015 14:00
No, it's all good, I've falsely attributed it to you
(as always :smiling_imp: )
Jan Sandbrink
@NobodysNightmare
Jul 14 2015 14:01
Actually I've read things like irreversibility around that time... and it is the first migration I've ever written ^^
cratz
@cratz
Jul 14 2015 14:28
change_column_default is irreversible as far as I know
so you should use "up" and "down"
like all other change_column methods
because rails is not a crystal ball and able to restore data from the past
or within "change" and Rails4 you can use something like that:
reversible do |direction|
    direction.up { User.update_all(location: 'Minsk') }
  end
ulferts
@ulferts
Jul 14 2015 16:08
Thanks for sharing @cratz. That explains it then