Giter VIP home page Giter VIP logo

Comments (18)

fniephaus avatar fniephaus commented on June 4, 2024

Interesting idea. I guess we could add support for something like #failOnWarnings to SCIMetacelloLoadSpec and then you could enable it by setting the value to True.

I wonder what @dalehenrich thinks about this.

BTW: I literally just made smalltalkCI ignore warnings (0a1f772) 😁 .

from smalltalkci.

dalehenrich avatar dalehenrich commented on June 4, 2024

My thoughts are that we'd like to fail on specific warnings rather than generic warnings ... @DamienCassou could you supply a stack that shows an example of the Warning you want ignored? If this is coming from Metacello, I'd be willing to create a specific class so that we can selectively fail ...

from smalltalkci.

DamienCassou avatar DamienCassou commented on June 4, 2024

I have the impression the warning comes from the compiler, in particular the Encoder>>undeclared: which signals an UndeclaredVariableWarning. This exception can be resumed. In Pharo, when Monticello loads a package containing a method with a reference to a non existing class, a message is shown in the transcript and loading continues. In my example, I have a package Foo-Main with a class FooMain with a method foo referencing a class in another package. If this dependency is not loaded, loading Foo-Main results in the following being shown in the transcript:

FooMain>>foo (FooDependency is Undeclared) 

from smalltalkci.

DamienCassou avatar DamienCassou commented on June 4, 2024

Metacello, in MetacelloMCVersionValidator>>validateCleanLoadAndTestsForVersion:loads: has code related to this exception as well.

from smalltalkci.

dalehenrich avatar dalehenrich commented on June 4, 2024

As I think about the UndeclaredVariableWarning, I'm pretty sure that the Warning can be thrown in cases where the global will be resolved by another package being loaded a bit later during the same project load ... so it is not fool proof ...

I deal with this in GemStone by having a test that detects sent but no implemented methods and undeclared globals ...

from smalltalkci.

DamienCassou avatar DamienCassou commented on June 4, 2024

Marcus told me the class Encoder is not used anymore, it's the old compiler. What is important now is that the new compiler signals OCUndeclaredVariableWarning when a method references an undeclared variable. I would like the code loader to signal an error if this warning is signaled. Is that possible?

from smalltalkci.

DamienCassou avatar DamienCassou commented on June 4, 2024

@dalehenrich you are right. But this warning typically indicates a bad dependency: if my packages and configuration are correct, there should not be any undeclared variable at any point of the loading process; Metacello should load packages in the right order. If there is an undeclared variable at any point, it means the configuration is incorrect (a dependency is not yet loaded) or there are circular dependencies. I would like the build to break so that I know I have a problem somewhere.

from smalltalkci.

dalehenrich avatar dalehenrich commented on June 4, 2024

@DamienCassou you are correct that it is a "bad dependency", but as you are aware, the universe is full of projects with bad dependencies that end up loading correctly...

Given that you have a specific exception to be caught, perhaps it makes sense to allow one to specify a list of Notifications that will cause a build to fail:

SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #failLoadOn : [ 'OCUndeclaredVariableWarning' ],
      #baseline : 'MyProject',
      #directory : 'packages',
      #platforms : [ #squeak, #pharo, #gemstone ]
    }
  ]
}

from smalltalkci.

DamienCassou avatar DamienCassou commented on June 4, 2024

@DamienCassou you are correct that it is a "bad dependency", but as you are aware, the universe is full of projects with bad dependencies that end up loading correctly...

I agree, that's why I'm not proposing to fail all builds because of that. But I want my packages to be free of such problems. i think your proposal makes sense.

from smalltalkci.

dalehenrich avatar dalehenrich commented on June 4, 2024

@fniephaus what do you think of #failLoadOn ... I could take this on if you'd like ... it's related to the #onWarningLog option ...

from smalltalkci.

fniephaus avatar fniephaus commented on June 4, 2024

Please do! This is an open source project and everyone is invited to contribute ;)

from smalltalkci.

Uko avatar Uko commented on June 4, 2024

πŸ‘ for having this option

from smalltalkci.

fniephaus avatar fniephaus commented on June 4, 2024

Does Metacello already have something similar to #failLoadOn or would you just catch the user-provided warnings manually and fail the build?

from smalltalkci.

dalehenrich avatar dalehenrich commented on June 4, 2024

No ... I was thinking that SmalltalkCI would need to handle that ...

from smalltalkci.

fniephaus avatar fniephaus commented on June 4, 2024

Thanks for the info, so we'd need to do this manually in SCIMetacelloLoadSpec>>basicLoadProjectOn:.

from smalltalkci.

fniephaus avatar fniephaus commented on June 4, 2024

@dalehenrich what do you think about this?

from smalltalkci.

dalehenrich avatar dalehenrich commented on June 4, 2024

@fniephaus I think I would like a stack or at least an error message stating why the build failed.

from smalltalkci.

fniephaus avatar fniephaus commented on June 4, 2024

Ups, good point...

from smalltalkci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.