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

Quality of life improvements #1292

Merged

Conversation

crimson-knight
Copy link
Member

@crimson-knight crimson-knight commented Aug 23, 2022

Description of the Change

  • Added github actions for CI instead of TravisCi
  • Updated ameba and improved the codebase to pass all ameba checks
  • Fixed a few failing tests for cookie functionality that relied on outdated crystal behavior
  • Changed the amber new command to check which node version a user has installed and adjust the node-sass sources based on the node version found
  • Bumped version from 1.2.1 to 1.3.0 because this is intended to be released so I can start creating content and publishing docs for the Amber community

Alternate Designs

Benefits

New Amber adopters will get a smoother experience when getting started using amber new

Possible Drawbacks

May impact pre 1.0.0 crystal users

…s resolves the redis-cli not reaching the redis service
drujensen
drujensen previously approved these changes Aug 24, 2022
src/amber/pipes/cors.cr Outdated Show resolved Hide resolved
@@ -90,6 +90,9 @@ module Amber::Router::Cookies
expires : Time? = nil, domain : String? = nil,
secure : Bool = false, http_only : Bool = false,
extension : String? = nil)
name = URI.encode_www_form(name)
Copy link
Member

Choose a reason for hiding this comment

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

Is this a breaking change?

Copy link
Member Author

Choose a reason for hiding this comment

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

No this is preserving the existing expected behavior. I had to check the std lib, and 2 years ago the behavior for setting cookie names changed from implicitly encoding names and values to not encoding them at all. So I added this to preserve the expected behavior.

Now that I've said that I need to check and see if this means Amber will only work as expected on Crystal 1.0+

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah looks like this behavior changed as of 1.0 crystal-lang/crystal#10485

@@ -0,0 +1,35 @@
on:
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to be running all the different combinations of tests. I thought we ran against postgres, mysql and sqlite. Also, I thought we tested different templating options using docker compose.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll look into expanding the combination of tests more. I'm not very familiar with GHA and I'm just trying to make it work to start.

Copy link
Member Author

Choose a reason for hiding this comment

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

And FYI I still have 10 failing tests to fix, so I won't merge this until at least everything is green on my repo

…he actual question, and fixed the to_h method doing too much to return a hash
@drujensen
Copy link
Member

@crimson-knight Anyway to test this locally first? I'm getting a lot of emails asking for reviews.

@crimson-knight
Copy link
Member Author

@drujensen sorry about that! As far as the GHA go, I haven't found a way to test that workflow locally. I did take a look at the test suite and it appears within that is where we are testing the different db adapters (mostly SQLite and PG). It looks like the tests that are failing on GHA are possibly related to differences in how CI runs the tests so I may have to configure this to use a docker image to run the actual tests to simulate a local env.

My local tests all pass, 480/480 now so I can merge this any time and stop email bombing you for a re-review :)

@crimson-knight
Copy link
Member Author

@drujensen I have this at a satisfactory level for now. Github actions probably need a little more tweaking, but locally I get 480/480 tests passing, and some of these tweaks will help users on newer systems to use Amber smoothly.

I'd like to get this reviewed and cut a release today if possible.

@crimson-knight
Copy link
Member Author

@robacarp can I get your review when you get a few minutes?

@crimson-knight crimson-knight merged commit 5a18acc into amberframework:master Oct 26, 2022
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.

3 participants