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
Fixes #26411 - Inline bastion as an engine #8032
Conversation
Issues: #26411 |
First commit pulls in bastion as is in katello/bastion master, second commit adapts it to an engine. |
[test katello] |
@waldenraines @johnpmitsch one thing that @ehelms brought when chatting about this PR, is if we want to do a gitsubtree to try to preserve all the history, or just merge it as it is (all in one commit). Curious your thoughts |
Here's a todo list:
My current thinking is to modify it so that:
sets up and runs tests for 'bastion', while:
does this for bastion_katello. Thoughts? |
6079ae5
to
ebd4d3f
Compare
I don't have much experience with git sub-modules or sub-trees so its hard for me to say. My initial thoughts are if it introduces more complexity we should just merge it as is. I imagine the bastion repo will still be around (but defunct) and that will still have the original commit history? But maybe I don't see the benefits, would the submodule be beneficial for packaging reasons?
Having these as rake tasks always felt odd to me. Can we consider adding the grunt tasks to |
It would just be for preserving history. Imagine importing all of bastion and its ~1500 commits directly into katello within a subdirectory. The only thing we gain is commit history, but we'd be adding ~1500 commits to the tree. The files on the file system of master would end up looking exactly the same.
That sounds reasonable, can you provide any pointers on how to do that? I'm happy to look into it. |
sure thing, you would want to replicate the commands in Bastion's Rakefile in the script section in Katello's package.json This is what I'm thinking: {
"bastionTests: "cd ./bastion && grunt ci",
"bastionSetup": "cd ./bastion && ./setup_npm",
"allJavascriptTests: "npm run bastionSetup && npm run bastionTests && npm test" // maybe have another one with no setup
} Then add a setup npm script as executable |
I get the general concept, I'm just failing to see the benefit. The commits would be preserved on the original Bastion repo assuming we are keeping it around, so if people want the commits for professional reasons, they are still there. It seems like more complexity for no clear reason but I'm open to being persuaded otherwise! :) |
@johnpmitsch thats the way i was leaning as well, just wanted to open it up for discussion. Thanks! |
I agree with this and we could take it a step further to replace bower entirely with a package.json and npm scripts if we ended up moving bastion into webpack. For now I think we should do whatever is easiest to maintain functionality although I would also argue that the actual rake tasks themselves could go away.
I personally don't care about the history. Half of the history is "Bump bastion to version x" anyway. If we ever need the history we can check out the old repo and look at it there or on github. |
The difference with preserving commits is the use of tools like git log or tig or blame to trace the history within the git repository itself. The original repository can be explored, it will just be more work for developers. Just adding some color. |
I played around and I think we can keep things as is, simplify and fix the CI setup with:
And this PR for infra -- theforeman/foreman-infra#1006 I'd also ask for the following preparation PRs to have:
|
@ehelms i like this as it makes things simple and you've done part of the work :) let me work on those things, thanks! |
I forgot to mention you can then just drop those Rakefiles.
…On Wed, Mar 27, 2019, 9:40 PM Justin Sherrill ***@***.***> wrote:
@ehelms <https://github.com/ehelms> i like this as it makes things simple
and you've done part of the work :)
let me work on those things, thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8032 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAR584K0IBbWyRQccED3726ozSTT4OUKks5vbB2kgaJpZM4b8byh>
.
|
ebd4d3f
to
5495499
Compare
I guess we'd also want to update the developer documentation if we're no longer going to support |
[test katello] |
5495499
to
63806ae
Compare
63806ae
to
bb33cb6
Compare
@@ -188,13 +188,13 @@ Open the file, and add the following lines (with empty lines above and below for | |||
To setup a development environment, clone the repository or your fork of the repository. From the git checkout, setup the required development dependencies by running: | |||
|
|||
``` | |||
rake bastion:setup | |||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does only npm install
work to setup everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at theforeman/foreman-packaging#3559
it looks like it does, except for this step:
sh "cp -rf \$(cat foreman/bastion-version) engines/bastion_katello/bastion-${bastion_version}"
@ehelms would it make sense to just create a symlink there so we don't have to do that step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only ask because it looks like more steps, but not sure if they are redundant. I can test it out soon too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and one more step here: "npm install bastion-${bastion_version}". Which i'll add to the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ehelms could this be replaced with just 'npm install ../bastion' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i pushed some updated docs, and added simple instructions to ./engines/katello_bastin/README.mc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does only
npm install
work to setup everything?
I suppose that I forgot we commit all vendor files to source control so there is no need to run bower unless you're updating a dependency.
It should be possible to remove bower entirely since we aren't really updating dependencies that often and replace it with npm and webpack in a later PR.
``` | ||
|
||
After making changes, tests and linting can be run via: | ||
|
||
``` | ||
rake bastion:ci | ||
grunt ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan on adding these to Katello's package.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after @ehelm's suggestion, i decided to not do that (sorry should have mentioned that here). I'd rather get this in quickly and then we can adjust if desired. Does that sound okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries, gotta draw the line somewhere :) I guess there is a difference between testing bastion and bastion_katello and I'm forgetting this too!
I'll try to do a follow up PR adding these to package.json
, maybe we could have a single npm run ci
command to run everything we expect jenkins to do as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just be cautious given they both have their own package.json with dependencies and pathing configured based on their relative locations. Mixing these with the base katello dependencies and scripts might be more more mashing together than you necessarily want. If anything, I'd think you'd be better off investing in dropping all of the Grunt infrastructure in favor of native scripts (but even that may not be worth the time if the webpack/React is the future).
bb33cb6
to
638d020
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any other issues and CI is happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great change!
We're now getting a cyclic failure when trying to build the katello rpm, could it be related to this change? |
attempting to handle this here: theforeman/foreman-packaging#3559 |
No description provided.