Skip to content

Promote the YAML config on project import #5444

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

Closed

Conversation

davidfischer
Copy link
Contributor

This PR modifies the manual import screen to streamline things and promote the YAML config file for importing new repositories.

  • Link the YAML configuration docs
  • Update the YAML configuration docs to have a commented YAML file with the most common options
  • Remove the "advanced project options". All of those can be set after the project is built except documentation type (eg. sphinx) and that can be set in the YAML config.

Fixes #5414

Screenshots

Before

Screen Shot 2019-03-12 at 9 37 17 PM

After

Screen Shot 2019-03-12 at 9 37 30 PM

@davidfischer davidfischer requested review from stsewd and a team March 13, 2019 04:59
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I think it's important to check corporate before merge it and probably adapt the code there as well.

This PR modifies the manual import screen to streamline things and promote the YAML config file for importing new repositories.

It seems that it does also affect the "automatic" import from VCS services, not only "Manual import".

@@ -255,16 +254,11 @@ class ImportWizardView(ProjectSpamMixin, PrivateViewMixin, SessionWizardView):

form_list = [
('basics', ProjectBasicsForm),
('extra', ProjectExtraForm),
Copy link
Member

Choose a reason for hiding this comment

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

If we ending up with only one form in this list, we may remove the SessionWizardView and handle this as a normal view.

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 corporate code actually relies on self.form_list. That's why I didn't completely refactor this view.

Copy link
Member

Choose a reason for hiding this comment

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

Why not refactor the corporate code for this as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm trying to make the scope of the change smaller rather than larger.

kwargs['user'] = self.request.user
if step == 'basics':
kwargs['show_advanced'] = True
kwargs = {'user': self.request.user}
Copy link
Member

Choose a reason for hiding this comment

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

This ImportWizardView view is overridden in the corporate site, we probably need to make some changes there together with this PR and double check that this process still works there. Can you test it and apply the same changes there?

@@ -8,15 +8,26 @@ Here is an example of how this file looks like:

.. code:: yaml
Copy link
Member

Choose a reason for hiding this comment

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

Instead of the above line saying,

Here is an example of how this file looks like:

what about saying something like "Here is a minimum example configuration file:" or some better phrase than that one but making it clear that it's the minimum inviting the user to copy and paste as is other than keep reading the whole page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's a few changes so that the YAML docs are better "at a glance". I think that should be a separate PR but I can take care of this small change here.

@davidfischer
Copy link
Contributor Author

It seems that it does also affect the "automatic" import from VCS services, not only "Manual import".

I'll take a look at that. I thought they were totally separate.

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

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

I also think we should check the corporate site and that import from remote repos still works, but looks good to me :)

@davidfischer
Copy link
Contributor Author

As-is, this change works fine with the corporate side and with the automatic import via VCS integrations. Interestingly, the automatic import with integrations sends the project description but that was never used with the advanced form.

This change does impact the corporate side in that there will be no way to specify before importing to use a different documentation type (eg. mkdocs, sphinx dirhtml) other than with the YAML file. Are we ok with that?

I do think that it could simplify things to refactor the ImportWizardView to not be a wizard but just be a regular view. That is a bigger change however as it involves completely refactoring the view on .org and where it is overridden in .com. I am not opposed to it but it will take a bit more time and coordination. Thoughts?

@stsewd
Copy link
Member

stsewd commented Mar 13, 2019

This change does impact the corporate side in that there will be no way to specify before importing to use a different documentation type (eg. mkdocs, sphinx dirhtml) other than with the YAML file. Are we ok with that?

I'm not sure, I mean people using a different location from sphinx will face an error too or people that need a requirements file, and they need to go the admin page anyway.

So, I'm ok with removing the advanced options from the import menu, something we can't do is remove the advanced option from the admin page, not till we have a solution for changing settings to build old versions of docs

@davidfischer
Copy link
Contributor Author

So, I'm ok with removing the advanced options from the import menu, something we can't do is remove the advanced option from the admin page, not till we have a solution for changing settings to build old versions of docs

Agreed.

@humitos
Copy link
Member

humitos commented Mar 18, 2019

This change does impact the corporate side in that there will be no way to specify before importing to use a different documentation type (eg. mkdocs, sphinx dirhtml) other than with the YAML file. Are we ok with that?

I'm not 100% convinced yet.

On one side, if we want to promote the YAML file and make the user to use it, giving the "Advanced" options at import time is not a good idea.

On the other side, the on-boarding experience for all the MkDocs projects won't be amazing (the first build will always fail --unless a YAML file propoerly configured already exists in the repo)

I do think that it could simplify things to refactor the ImportWizardView to not be a wizard but just be a regular view. That is a bigger change however as it involves completely refactoring the view on .org and where it is overridden in .com. I am not opposed to it but it will take a bit more time and coordination. Thoughts?

I'm 👍 on this. Although, if this PR is ready to be merged, we can merge it and make the refactor as a second step.

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

On the other side, the on-boarding experience for all the MkDocs projects won't be amazing (the first build will always fail

Actually, there a lot of projects that will fail if they are not correctly setup, like having the correct requirements file, having the conf.py file in another directory than docs, needing to install the project, etc. We were trying to do some magic trying to guess this stuff, but in the end it caused more problems in my opinion.

@ericholscher
Copy link
Member

I wonder if it's worth just adding the callout to the YAML file for now, but allowing users to edit advanced options still? That way we get both benefits, but don't make a worse experience for users who are not on YAML yet.

@stsewd stsewd deleted the davidfischer/promote-config-on-file-import branch March 18, 2019 20:07
@davidfischer
Copy link
Contributor Author

I just wanted to comment here in case we come back to this. We decided to go with #5485 which does the promotion without removing the advanced project settings for now. The advanced project settings can probably go away but it looks like it is a bigger change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants