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

Rails5 ActiveRecord monkey patch for SchemaDumper #2571

Merged
merged 9 commits into from Jun 24, 2020
Merged

Conversation

briri
Copy link
Contributor

@briri briri commented Jun 23, 2020

Fixes the issue with the SchemaDumper outputting non DB agnostic information.

briri and others added 4 commits June 23, 2020 09:57
…eaner config to skip ActiveRecord table, re-dumped schema
…3 Q16 x86_64 2019-05-03 https://imagemagick.org

Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype heic jng jp2 jpeg lcms ltdl lzma openexr png tiff webp xml zlib
Usage: import [options ...] [ file ]

Image Settings:
  -adjoin              join images into a single multi-image file
  -border              include window border in the output image
  -channel type        apply option to select image channels
  -colorspace type     alternate image colorspace
  -comment string      annotate image with comment
  -compress type       type of pixel compression when writing the image
  -define format:option
                       define one or more image format options
  -density geometry    horizontal and vertical density of the image
  -depth value         image depth
  -descend             obtain image by descending window hierarchy
  -display server      X server to contact
  -dispose method      layer disposal method
  -dither method       apply error diffusion to image
  -delay value         display the next image after pausing
  -encipher filename   convert plain pixels to cipher pixels
  -endian type         endianness (MSB or LSB) of the image
  -encoding type       text encoding type
  -filter type         use this filter when resizing an image
  -format "string"     output formatted image characteristics
  -frame               include window manager frame
  -gravity direction   which direction to gravitate towards
  -identify            identify the format and characteristics of the image
  -interlace type      None, Line, Plane, or Partition
  -interpolate method  pixel color interpolation method
  -label string        assign a label to an image
  -limit type value    Area, Disk, Map, or Memory resource limit
  -monitor             monitor progress
  -page geometry       size and location of an image canvas
  -pause seconds       seconds delay between snapshots
  -pointsize value     font point size
  -quality value       JPEG/MIFF/PNG compression level
  -quiet               suppress all warning messages
  -regard-warnings     pay attention to warning messages
  -repage geometry     size and location of an image canvas
  -respect-parentheses settings remain in effect until parenthesis boundary
  -sampling-factor geometry
                       horizontal and vertical sampling factor
  -scene value         image scene number
  -screen              select image from root window
  -seed value          seed a new sequence of pseudo-random numbers
  -set property value  set an image property
  -silent              operate silently, i.e. don't ring any bells
  -snaps value         number of screen snapshots
  -support factor      resize support: > 1.0 is blurry, < 1.0 is sharp
  -synchronize         synchronize image to storage device
  -taint               declare the image as modified
  -transparent-color color
                       transparent color
  -treedepth value     color tree depth
  -verbose             print detailed information about the image
  -virtual-pixel method
                       Constant, Edge, Mirror, or Tile
  -window id           select window with this id or name
                       root selects whole screen

Image Operators:
  -annotate geometry text
                       annotate the image with text
  -colors value        preferred number of colors in the image
  -crop geometry       preferred size and location of the cropped image
  -encipher filename   convert plain pixels to cipher pixels
  -geometry geometry   preferred size or location of the image
  -help                print program options
  -monochrome          transform image to black and white
  -negate              replace every pixel with its complementary color
  -quantize colorspace reduce colors in this colorspace
  -resize geometry     resize the image
  -rotate degrees      apply Paeth rotation to the image
  -strip               strip image of all profiles and comments
  -thumbnail geometry  create a thumbnail of the image
  -transparent color   make this color transparent within the image
  -trim                trim image edges
  -type type           image type

Miscellaneous Options:
  -debug events        display copious debugging information
  -help                print program options
  -list type           print a list of supported option arguments
  -log format          format of debugging information
  -version             print version information

By default, 'file' is written in the MIFF image format.  To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps).  Specify 'file' as '-' for
standard input or output. statements in stats files
@xsrust
Copy link
Contributor

xsrust commented Jun 24, 2020

The above commit replaces the import statements (which I can't find any ruby-documentation on) with the suggested circular-dependancy-fix from the parallelization library.

It seems that the ESlint is failing now preventing tests from running.
The AirBNB config is incompatible with eslint v7.3.0:
airbnb/javascript#2245
Suggested fix is to downgrade to 7.2.0 or upgrade to 7.3.1

@xsrust
Copy link
Contributor

xsrust commented Jun 24, 2020

Pull in the latest from the Rails5 branch (ajax was causing some conflicts/issues on the PR but not the Push tests)

@xsrust
Copy link
Contributor

xsrust commented Jun 24, 2020

Success,
The tests now run for PR and Push.
there are some failures, but we can split that work off into other tickets after we've merged into Rails5

Gemfile Outdated
@@ -71,6 +71,9 @@ gem "pg", group: :pgsql, require: false
# Bit fields for ActiveRecord (https://github.com/pboling/flag_shih_tzu)
gem "flag_shih_tzu" #, "~> 0.3.23"

# Required for the `import` statements at the top of the Stat generators
gem "activerecord-import"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this gem is for the bulk-import of data and generating minimal SQL statements rather than for the Ruby-import keyword.

I've reverted the import statements from the services, but the commit that added this references imagemagick so I wanted to double check before removing this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes. I thought I had reverted that change.

@briri
Copy link
Contributor Author

briri commented Jun 24, 2020

Ok thanks for updating this PR @xsrust. I have reverted out that gem and can see that the tests are failing on other issues. I will open a new ticket for that. It looks like the addition of optional: true to some of the associations on the models have invalidated our unit tests.

@briri briri merged commit 2848351 into rails5 Jun 24, 2020
@briri briri deleted the rails5-ar-monkeypatch branch June 24, 2020 16:15
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

Successfully merging this pull request may close these issues.

None yet

4 participants