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

Lock file implementation #27

Merged
merged 5 commits into from
Sep 11, 2015
Merged

Lock file implementation #27

merged 5 commits into from
Sep 11, 2015

Conversation

ysbaddaden
Copy link
Contributor

  • install command:
    • load lock file before install command
    • enforce locked versions
    • eventually generate lock file (if missing or outdated)
  • update command:
    • eventually generate lock file
  • versioned lock file for future expansions / refactors
  • integration tests
  • drop custom groups
  • add --production parameter to skip development dependencies

closes #12 #31

@ysbaddaden ysbaddaden self-assigned this Sep 4, 2015
@ysbaddaden ysbaddaden added this to the v0.4.0 milestone Sep 4, 2015
@ysbaddaden
Copy link
Contributor Author

It looks like this is requiring Crystal HEAD.


unless lock_file?
File.open(lock_file_path, "w") { |file| manager.to_lock(file) }
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The install command must regenerate the lock file in case any new package was installed.

@ysbaddaden ysbaddaden force-pushed the feature/lock-file branch 2 times, most recently from 1c9de2b to a100a01 Compare September 9, 2015 20:20
@ysbaddaden
Copy link
Contributor Author

Sadly, custom groups are behaving badly with the lock file.

Either we have to resolve everything, which means cloning every dependency (whatever group we want to install); or the lock file lists the shards for the selected groups only, which results in a bad lock file (somehow truncated).

I think I'll remove the ability to have and select custom groups and keep the development group only, until we can figure out how to properly deal with it.

@jhass
Copy link
Member

jhass commented Sep 10, 2015

Yeah, bundler can only do it since it can fetch the whole graph via rubygems.org's dependency API.

The lock file now contains a `version:` key (set at 1.0 for now) and
dependencies are listed under the `shard:` key, this in order to be
more future-proof to changes.
ysbaddaden added a commit that referenced this pull request Sep 11, 2015
Groups don't play well with the lock file. Trying to install custom
groups broke the lock file that no longer contained some shards (eg:
development) but would contain some others (eg: custom).

Only the development group has been kept, along with the ability to
not install this group, which can be useful when deploying an
application to build in production. The lock file won't be generated
or overwritten when the development group isn't installed, since it
would have the same problem than described above.

The `--without development` argument may be renamed `--production`
in the future, and won't allow to add or remove dependencies.

refs #27
Groups don't play well with the lock file. Trying to install custom
groups broke the lock file that no longer contained some shards (eg:
development) but would contain some others (eg: custom).

Only the development group has been kept, along with the ability to
not install this group using the `--production` flag, which can be
useful when deploying an application to be built in production. The
lock file won't be generated or overwritten in this case, and
installation will fail if a dependency has been added but isn't in
the lock file.
ysbaddaden added a commit that referenced this pull request Sep 11, 2015
@ysbaddaden ysbaddaden merged commit 414833c into master Sep 11, 2015
@ysbaddaden ysbaddaden deleted the feature/lock-file branch September 11, 2015 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lock dependencies
3 participants