Skip to content

Conversation

@ekohl
Copy link
Member

@ekohl ekohl commented Oct 8, 2018

No description provided.

@ohadlevy
Copy link
Member

ohadlevy commented Oct 8, 2018

could you also add nodejs-jed as a dependency ? imho theforeman/foreman#5342 will be merged today.

@ekohl ekohl force-pushed the rpm/update-foreman-deps branch from fa04f35 to e607669 Compare October 8, 2018 14:13
@ekohl
Copy link
Member Author

ekohl commented Oct 8, 2018

It fails with a compilation error that I can't quite explain:

ERROR in ./webpack/assets/javascripts/react_app/components/AutoComplete/auto-complete.scss
Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve 'react-bootstrap-typeahead/css/Typeahead.css' in '/builddir/build/BUILD/foreman-1.20.0-develop/webpack/assets/javascripts/react_app/components/AutoComplete'
    at factoryCallback (/usr/lib/node_modules/webpack/lib/Compilation.js:282:40)
    at factory (/usr/lib/node_modules/webpack/lib/NormalModuleFactory.js:237:20)
    at resolver (/usr/lib/node_modules/webpack/lib/NormalModuleFactory.js:60:20)
    at asyncLib.parallel.e (/usr/lib/node_modules/webpack/lib/NormalModuleFactory.js:127:20)
    at /usr/lib/node_modules/webpack/node_modules/async/dist/async.js:3888:9
    at /usr/lib/node_modules/webpack/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/usr/lib/node_modules/webpack/node_modules/async/dist/async.js:1062:13)
    at /usr/lib/node_modules/webpack/node_modules/async/dist/async.js:969:16
    at /usr/lib/node_modules/webpack/node_modules/async/dist/async.js:3885:13
    at resolvers.normal.resolve (/usr/lib/node_modules/webpack/lib/NormalModuleFactory.js:119:22)
    at onError (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:65:10)
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at runAfter (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
    at innerCallback (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at next (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:252:11)
    at /usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:40:4
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at runAfter (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
    at innerCallback (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at next (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:252:11)
    at innerCallback (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:144:11)
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at next (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:249:35)
    at resolver.doResolve.createInnerCallback (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:44:6)
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at afterInnerCallback (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:166:11)
    at loggingCallbackWrapper (/usr/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    at next (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:249:35)
 @ ./webpack/assets/javascripts/react_app/components/AutoComplete/index.js 51:0-31
 @ ./webpack/assets/javascripts/react_app/components/SearchBar/SearchBar.js
 @ ./webpack/assets/javascripts/react_app/components/SearchBar/index.js
 @ ./webpack/assets/javascripts/react_app/components/componentRegistry.js
 @ ./webpack/assets/javascripts/react_app/common/MountingService.js
 @ ./webpack/assets/javascripts/bundle.js

@Ron-Lavi
Copy link
Member

Ron-Lavi commented Oct 8, 2018

Interesting.. I will look more into it tomorrow :)

@ohadlevy
Copy link
Member

ohadlevy commented Oct 8, 2018

any chance this is similar to theforeman/foreman#6043 ? /cc @sharvit

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Oops, on mobile, didn't notice the failing build

@ohadlevy
Copy link
Member

ohadlevy commented Oct 8, 2018

@ekohl does the node_modules directory contain node_modules/react-bootstrap-typeahead/css/Typeahead.css ?

@ekohl
Copy link
Member Author

ekohl commented Oct 8, 2018

@ohadlevy no, it's an indirect dependency that's bundled via patternfly.

@ohadlevy
Copy link
Member

ohadlevy commented Oct 9, 2018

@ekohl where can I find the resulting node_modules directory? is it available on koji somewhere?

@Ron-Lavi
Copy link
Member

Ron-Lavi commented Oct 9, 2018

react-bootstrap-typeahead/css/Typeahead.css
is being added to patternfly TypeaheadSelect and seem to work there,
maybe it is something with foreman css-loaders ?

There is a small diff between patternfly and foreman scss loaders, but I am not sure it is causing the problem:

Foreman:

      test: /\.css$/,
      loaders: ['style-loader', 'css-loader']
    },
    {
      test: /\.scss$/,
      loaders: ['style-loader', 'css-loader', 'sass-loader']
    },

Patternfly:

      test: /\.css$/,
      loaders: ['style-loader', 'css-loader'],
     ...
    },
    // Sass
    {
      test: /\.scss$/,
      use: [
        { loader: 'style-loader' },
        { loader: 'css-loader' },
        ...
      ]
    }

@tbrisker
Copy link
Member

tbrisker commented Oct 9, 2018

looks like thie is the offensive code: https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-3/patternfly-react/sass/patternfly-react/_type-ahead-select.scss#L1 - patternfly-react seems to expect that on the top level.
if we can't fix it by tomorrow i'd rather we revert the search change and postpone it to after branching rather than delay branching or branch with broken code.

@ohadlevy
Copy link
Member

ohadlevy commented Oct 9, 2018 via email

@ohadlevy
Copy link
Member

ohadlevy commented Oct 9, 2018

@tbrisker I find it odd, as patternfly require a lot of packages, and so far we had no problems with yet, I assume here there is something to do with how the node_modules we generate looks like using packages, if we have a way to get a sample of it, maybe we can figure out whats exactly wrong. regardless, I would hope just packaging it as top level can solve the issue?

@ekohl
Copy link
Member Author

ekohl commented Oct 9, 2018

I do think packaging it at the top level would be a short term fix. Previously the package was unbundled so perhaps that's why we weren't seeing it. Perhaps the ~package import always expects things to be at the top level though I wonder why that isn't the case with a npm install.

@ekohl
Copy link
Member Author

ekohl commented Oct 9, 2018

I stand corrected: after npm install it does show at the top level of node_modules. It looks like npm prefers to install at the top level but only bundle if there's a conflict. I've tried to keep as much packages unbundled because I thought it was cleaner. Looks like that approach is closer to matching what npm does already.

@ohadlevy
Copy link
Member

ohadlevy commented Oct 9, 2018

@ekohl are you suggesting the package is on the top level already? (and that webpack can't find it regardless?)
@tbrisker another work around we can do is simply copying the relevant css to our code, and drop the import statement, removing the entire search feature imho should be last resort... :(

@ekohl
Copy link
Member Author

ekohl commented Oct 9, 2018

@ekohl are you suggesting the package is on the top level already? (and that webpack can't find it regardless?)

No, I'm saying we have most packages at top level but with patternfly we switched from unbundled to bundled in the latest update. That's why we might be seeing this now and not before.

@ohadlevy
Copy link
Member

ohadlevy commented Oct 9, 2018

No, I'm saying we have most packages at top level but with patternfly we switched from unbundled to bundled in the latest update. That's why we might be seeing this now and not before.

so in this case, maybe even reverting won't help as its just the first error out of a few others...?

@tbrisker
Copy link
Member

tbrisker commented Oct 9, 2018

OK, what is the next step than? Should we return patternfly-react to be unbundled?

@Ron-Lavi
Copy link
Member

Ron-Lavi commented Oct 9, 2018

In case we don't want the SearchBar styles to block this PR
and until we decide whether to change patternfly-react bundle or not,
I've created this PR,
where we save locally that css file we need to import.

@ekohl
Copy link
Member Author

ekohl commented Oct 9, 2018

OK, what is the next step than? Should we return patternfly-react to be unbundled?

I am leaning to that yes.

@tbrisker
Copy link
Member

tbrisker commented Oct 9, 2018

@ekohl let's do that then, we need to have working nightlies prior to branching.

@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

For completeness: #3077

@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

When https://ci.theforeman.org/job/foreman-packaging-release/147/ is done the tests can be restarted.

@tbrisker
Copy link
Member

[test rpm]

@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

Looks like our repoclosure check doesn't take repositories into account. nodejs-invariant is in the katello repository but Foreman can't use that. Going to do some shuffling

@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

I stand corrected, it was a release issue. foreman-packaging-release can't deal with a package already existing and http://koji.katello.org/koji/buildinfo?buildID=27723 was already built. It was skipped but is tagged to the wrong repo. During the PR it was built locally as a scratch and so repoclosure passed.

@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

[test rpm]

1 similar comment
@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

[test rpm]

@ekohl
Copy link
Member Author

ekohl commented Oct 10, 2018

Since it's green now, I'm going to merge this. Haven't verified the actual in UI functionality but it'll at least unblock our builds.

@ekohl ekohl merged commit 92e73aa into theforeman:rpm/develop Oct 10, 2018
@ekohl ekohl deleted the rpm/update-foreman-deps branch October 10, 2018 19:43
@tbrisker
Copy link
Member

Thanks for all the hard effort @ekohl !

@ohadlevy
Copy link
Member

ohadlevy commented Oct 10, 2018 via email

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.

5 participants