Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Nucleus release issue #32

Closed
Hywan opened this issue Jan 14, 2016 · 66 comments
Closed

Nucleus release issue #32

Hywan opened this issue Jan 14, 2016 · 66 comments

Comments

@Hywan
Copy link
Member

Hywan commented Jan 14, 2016

Hello :-),

We have a big issues with the not-finalized libraries. They are tagged as 0.*. We require ~0.0 in this case. This is wrong. Here is why.

Try this:

{
    "require": {
        "hoa/ruler": "~1.0"
    }
}

and then

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing hoa/core (2.15.11.09)
    Loading from cache

  - Installing hoa/visitor (1.15.08.17)
    Loading from cache

  - Installing hoa/exception (1.16.01.11)
    Loading from cache

  - Installing hoa/consistency (1.16.01.11)
    Loading from cache

  - Installing hoa/event (1.16.01.11)
    Loading from cache

  - Installing hoa/protocol (1.16.01.11)
    Loading from cache

  - Installing hoa/stream (0.16.01.11)
    Loading from cache

  - Installing hoa/iterator (1.15.10.29)
    Loading from cache

  - Installing hoa/file (0.15.11.09)
    Loading from cache

  - Installing hoa/ustring (3.15.11.09)
    Loading from cache

  - Installing hoa/compiler (2.15.10.29)
    Loading from cache

  - Installing hoa/regex (0.15.08.13)
    Loading from cache

  - Installing hoa/math (0.15.10.26)
    Loading from cache

  - Installing hoa/ruler (1.15.11.09)
    Loading from cache

See what's wrong here? Because of hoa/stream in 0.…, it will load 0.16.01.11 and then hoa/consistency etc., and it will create a conflict with hoa/core.

To solve this, this is easy. Track all composer.json files with a ~0.0 dependency, and add this: ~0.0,<=0.15, it will work. However, I don't want to create another branch just for that, so here is my proposal:

  • Track all composer.json with ~0.0 dependencies,
  • Change them to ~0.15.0 or ~0.0,<=0.15,
  • Commit on master,
  • Release a new 0.15.12.31 snapshot,
  • Undo the change in composer.json and re-commit,
  • Maybe release a new snapshot, but it's not necessary.

What do you think @hoaproject/hoackers?

@shulard
Copy link
Contributor

shulard commented Jan 14, 2016

Hello @Hywan!

Is there a way to find quickly all the wrong composer.json repos to update ?

Why rolling back to previous composer version ?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

No it won't work with this workflow. We need new branches. cc @CircleCode

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@shulard ag is your friend.

@CircleCode
Copy link
Member

I also don't get the point in rolling back the change
what's the point about having new branches?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Forget my proposal. How will you fix this situation? Do you understand it?

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

I'm not really aware of what is possible to do with composer but is there a way to have a conditional rules in composer.json like if Hoa\Core > ~3.0 then use Hoa\SomeLib ~0.16 else Hoa\SomeLib ~0.15

@shulard
Copy link
Contributor

shulard commented Jan 14, 2016

It seems ok now with the new consistency snapshot... I tried to install ruler: ~1.0 and it works.

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@shulard No it cannot. This is not related.

@CircleCode
Copy link
Member

To be honest, I think the real problem is that we have stable (tagged) libraries requiring unstable ones.
This mean the assertion "this stable library won't do any BC break" is false since a bc break can occur in any 0.* required library causing the code using the stable library to stop working…

@CircleCode
Copy link
Member

ATM, I don't see any elegant way of solving this.

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@CircleCode Exactly, and we are working hard on finalizing (making them stable). But we have an issue right now :-). How to solve it?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@CircleCode Maybe just throw a notice? With apologies.

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

@Hywan we have ton find a way to flag BC on unstable lib

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@CircleCode Here is a new proposal. Let's consider hoa/ruler. Checkout 1.15.* (the latest before the BC break), then make the change in the composer.json file to only require ~0.0,<0.15 for instance, then commit, release a new snapshot, and here we go. We will have another branch. This is eleguant, isn't it?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@Jir4 We should not have unstable libraries in fact.

@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

@Hywan We need tell them to specify the release of all the beta dependencies.

It's like that i solve my problem when i reporting the issue Monday morning.

@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

until they have drop Hoa\Core

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

@Hywan a lib cannot be stable from the beginning, so for each lib that we will able to add, it will have some times where the lib will be unstable

@CircleCode
Copy link
Member

@Pierozi I'm not sure Hoa\Core is THE point: future BC breaks in 0.* libs will do the same.
We have to find a future proof way of handling this.
But your points is interesting: isn't it a way of solving it by letting the user know this point and doing something in its composer file?

@Hywan @Jir4

We should not have unstable libraries in fact.

a lib cannot be stable from the beginning…

I think we MUST NOT (rather than should not) have unstable libraries required by stable libraries.
How many unstable libraries are concerned?
On the opposite, if a user explicitely requires a unstable library, up to him to handle its composer requirements.

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

@CircleCode i agree with your last sentence

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

So

@Hywan
Maybe just throw a notice? With apologies.

And expain what to do ? (explain in #32 (comment))

@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

@CircleCode you right future BC between dependencies can still exist.

We cannot specify in composer.json a conflit version ?
When trying to load Hoa\Core and Hoa\Stream > 0.16 throw an warning for refuse install

@CircleCode
Copy link
Member

the problem is: is there a way to fix it on the user side?
since the problem occurs on indirect dependencies (requirements from a lub required by the user), i'm not sure its master composer can restrict versions

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

@CircleCode checking git tag ? ^^

@CircleCode
Copy link
Member

if it can be fixed on user side, so we juste have to apologize, explain it, and stabilize any lib required by a stable lib.

Again, how many unstable libraries are concerned? (I mean, how many unstable libs arerequired by stable ones?)

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@CircleCode only until next BC break…

Nop, because we will avoid having unstable dependencies.

So, @hoaproject/hoackers, what do you suggest? We have to take a decision. Maybe we have to make a vote?

@CircleCode
Copy link
Member

Nop, because we will avoid having unstable dependencies.

what does it mean for stable libs currently depending of unstable libs?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@CircleCode We have to stabilize unstable libs and this situation will not happen anymore.

@thehawk970
Copy link

Make an snapshot with "0.15.0" make sense as an hotfix :D.
And its lets us some time to stabilize unstable libs

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

I have another idea.

We can delete the latest tags of unstable libraries. Thus, the problem disappears. Then, we create another snapshot but as stable. Most libraries are stables now.

Thoughts @hoaproject/hoackers?

@CircleCode
Copy link
Member

I love this idea, but have some remarks:

  1. we don't have to do this on libs not required by any stable lib
  2. thus, this will imply the following rule: a lib can pass to a stable status only if all its dependencies are marked as stable (I love this rule)
  3. we will have to communicate on the tag deletion (this is not a problem, but it has to be done)

@Jir4
Copy link
Contributor

Jir4 commented Jan 14, 2016

@Hywan 👍 but we have to be sure that the lib is really stable

@CircleCode 👍 on all your points ( and an other 👍 for the 2, it will avoid further issues )

@thehawk970
Copy link

@Hywan 👍
@CircleCode 👍

@shulard
Copy link
Contributor

shulard commented Jan 14, 2016

Hey guys, it seems that you have found the simpler way to handle the current problem 😄.

For me the 3 points mentioned by @CircleCode are the right rules to be followed.

@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

That mean if i call Hoa\Ruler at version ~1.0 the Hoa\Stream dependency will be call at 0.* instead new stable 1.* ? i'm not sure

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@Pierozi Currently, hoa/ruler 1.* and 2.* require hoa/stream 0.*. What we are going to do is to bump hoa/stream to 1.*, and update hoa/ruler 2.* to use hoa/stream 1.* instead of 0.*. This way, it will work.

@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

Got it ! 👍

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@CircleCode @Jir4 Some unstable libraries are not required at all, like hoa/irc or hoa/math. Maybe we should keep them at unstable. But hoa/stream, hoa/socket, hoa/stringbuffer or hoa/file can be promoted as stable. I will start by these ones. Same for hoa/regex etc. Actually, the list is:

$ cat */composer.json | grep '~0.' | cut -d\  -f 9 | grep hoa | sed -e 's/[": ]*//g' | sort | uniq
hoa/devtools
hoa/dispatcher
hoa/file
hoa/graph
hoa/http
hoa/math
hoa/praspel
hoa/realdom
hoa/regex
hoa/socket
hoa/stream
hoa/stringbuffer
hoa/xml
hoa/xyl
hoa/zformat

This is all the libraries we need to update as stables.

Here we go:

  • hoa/devtools,
  • hoa/dispatcher,
  • hoa/file,
  • hoa/http,
  • hoa/math,
  • hoa/praspel,
  • hoa/realdom,
  • hoa/regex,
  • hoa/socket,
  • hoa/stream,
  • hoa/stringbuffer,
  • hoa/xml,
  • hoa/xyl,
  • hoa/zformat.

It should not take a lot of time.

Reminder of the strategy:

  • Cancel the last snapshot,
  • Create a new snapshot with devtools:snapshot -b (-b for BC break, it will bump 0 to 1),
  • Update all (needed) libraries to use these new snapshots,
  • Release them.

Agree?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Actually the strategy is not that simple. For instance, hoa/graph is required by hoa/acl, which is unstable. An unstable library can depends of unstable libraries. So we can remove it from the list (applied).

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Anyway, we can have a better strategy but the final list seems correct. All these libraries are stables. The API didn't change since a long time. Even if it changes, it will be a BC break. It's not a big deal.

Is everyone agree?

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

(just hoa/http which is a pure nightmare currently, but I don't care. PSR-7 will be BC break and it will be a good one).

@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

👍 Agree, about hoa/zformat she's the new one, but don't really a problem for me.

@Metalaka
Copy link
Member

@CircleCode, @Hywan Agree, seem good for me

@Pierozi Hoa\Zformat is maybe young but it's code isn't ;)

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

@Metalaka Exact about Hoa\Zformat.

I am starting. Then lunch, then night and I will finish this night.

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Note: I don't change the .State file.

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Done. All dependencies, except hoa/graph, are not 0.*.
Next step: Update composer.json files to use these new snapshots. I am going to prepare all the commits tonight and create the snapshot tomorrow.

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

To get the list of all libraries to update:

$ for i in `\ls`; do if test ! -f $i/composer.json; then continue; fi; cd $i; if test 0 != $(cat composer.json | grep '~0.' | wc -l); then echo $i; fi; cd ..; done

Hmm nop, actually we must filter by stable/unstable libraries. An unstable library (~0.*) can have unstable dependencies. So:

$ for i in `\ls`; do if test ! -f $i/composer.json; then continue; fi; cd $i; if test 0 != $(git tag | grep '0.16' | wc -l); then cd .. && continue; fi; if test 0 != $(cat composer.json | grep '~0.' | wc -l); then echo $i; fi; cd ..; done
Cli
Compiler
Console
Devtools
Dispatcher
Eventsource
File
Http
Json
Locale
Math
Mime
Praspel
Realdom
Regex
Router
Ruler
Socket
Stringbuffer
Test
Websocket
Worker
Xml
Xyl

So here is the progression list:

  • Cli,
  • Compiler,
  • Console,
  • Devtools,
  • Dispatcher,
  • Eventsource,
  • File,
  • Http,
  • Json,
  • Locale,
  • Math,
  • Mime,
  • Praspel,
  • Realdom,
  • Regex,
  • Router,
  • Ruler,
  • Socket,
  • Stringbuffer,
  • Test,
  • Websocket,
  • Worker,
  • Xml,
  • Xyl.

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Now, if I install hoa/ruler ~1.0, I will have:

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing hoa/core (2.15.11.09)
    Loading from cache

  - Installing hoa/visitor (1.15.08.17)
    Loading from cache

  - Installing hoa/iterator (1.15.10.29)
    Loading from cache

  - Installing hoa/stream (0.15.10.26)
    Loading from cache

  - Installing hoa/file (0.15.11.09)
    Loading from cache

  - Installing hoa/ustring (3.15.11.09)
    Loading from cache

  - Installing hoa/compiler (2.15.10.29)
    Loading from cache

  - Installing hoa/regex (0.15.08.13)
    Loading from cache

  - Installing hoa/math (0.15.10.26)
    Loading from cache

  - Installing hoa/ruler (1.15.11.09)
    Loading from cache

which is what we expect!
And now, if I change ~1.0 for ~2.0 and then update, it works great too:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing hoa/core (2.15.11.09)
  - Installing hoa/exception (1.16.01.11)
    Loading from cache

  - Installing hoa/consistency (1.16.01.14)
    Loading from cache

  - Installing hoa/event (1.16.01.11)
    Loading from cache

  - Removing hoa/visitor (1.15.08.17)
  - Installing hoa/visitor (2.16.01.11)
    Loading from cache

  - Removing hoa/iterator (1.15.10.29)
  - Installing hoa/iterator (2.16.01.11)
    Loading from cache

  - Installing hoa/protocol (1.16.01.11)
    Loading from cache

  - Removing hoa/stream (0.15.10.26)
  - Installing hoa/stream (1.16.01.14)
    Loading from cache

  - Removing hoa/file (0.15.11.09)
  - Installing hoa/file (1.16.01.15)
    Loading from cache

  - Removing hoa/ustring (3.15.11.09)
  - Installing hoa/ustring (4.16.01.11)
    Loading from cache

  - Installing hoa/zformat (1.16.01.14)
    Loading from cache

  - Removing hoa/compiler (2.15.10.29)
  - Installing hoa/compiler (3.16.01.14)
    Loading from cache

  - Removing hoa/math (0.15.10.26)
  - Installing hoa/math (1.16.01.15)
    Loading from cache

  - Removing hoa/regex (0.15.08.13)
  - Installing hoa/regex (1.16.01.15)
    Loading from cache

  - Removing hoa/ruler (1.15.11.09)
  - Installing hoa/ruler (2.16.01.15)
    Downloading: 100%

This is what we expect!

@Hywan Hywan closed this as completed Jan 14, 2016
@Pierozi
Copy link
Member

Pierozi commented Jan 14, 2016

@Hywan Good job !

@Hywan
Copy link
Member Author

Hywan commented Jan 14, 2016

Thank you everyone for your participations! Awesome community ❤️!

@Jir4
Copy link
Contributor

Jir4 commented Jan 15, 2016

@Pierozi 👍

@Hywan Thanks for all your work !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

7 participants