#119 Documentation page to set up development environment on Windows. Fixes #108
Merged 2 months ago by jflory7. Opened 2 months ago by phoenixabhishek.

Windows-specific documentation added
PhoeniXAbhisheK • 2 months ago  
file modified
+1

@@ -10,6 +10,7 @@

     :maxdepth: 2

  

     setup/development

+    setup/development_windows

     setup/authentication

  

     model

@@ -0,0 +1,84 @@

+ ===================================================

+  Setting up a development environment on Windows

+ ===================================================

+ 

+ This guide will take you through the process to setup your development environment on Windows OS.

+ 

+ Prerequisites

+ ===============

+ 

+ You will need the following programs installed on your system before proceeding with the setup.

+ 

+ #. `Git <https://git-scm.com/>`_

+ #. `Python <https://www.python.org/downloads/>`_ (version >= 3.5)

+ #. `Docker Desktop for Windows <https://hub.docker.com/editions/community/docker-ce-desktop-windows>`_ (Download, installation, and run instructions available)

+ #. Docker Compose (Docker Compose is included as part of Docker Desktop, but if you still need to download it, you can do it from `here <https://docs.docker.com/compose/install/>`_)

+ 

+ 

+ Setting up the development environment

+ ========================================

+ 

+ #. Fork the `current repository <https://pagure.io/fedora-commops/fedora-happiness-packets>`_ to your profile .

+ #. Clone this forked repository to your system using Git with the following command::

+ 

+     git clone "https://pagure.io/forks/<user_name>/fedora-commops/fedora-happiness-packets.git"

+ 

+     OR, if using ssh,

+ 

+     git clone "ssh://git@pagure.io/forks/<user_name>/fedora-commops/fedora-happiness-packets.git"

+ 

+ #. Once cloned, move inside the directory using the command::

+ 

+     cd fedora-happiness-packets

+ 

+ #. Start the Docker application(With elevated/admin access).

+ #. Run the client secret generation script::

+ 

+     chmod -x generate_client_secrets.sh

+     generate_client_secrets.sh

+ 

+     Here, you might get an error saying::

+ 

+     /bin/sh: ./generate_client_secrets.sh: not found

+ 

+     This occurs mostly due to line endings being CRLF instead or the required LF.

+     This can be changed by modifying the settings of your respective editor, or else from console using `this method <https://github.com/postlight/headless-wp-starter/issues/171#issuecomment-451682572>`_

+ 

+ #. To run the web server, run::

+ 

+     docker-compose up

+ 

+ Once executed successfully, you should be able to view the main page on `http://localhost:8000/ <http://localhost:8000/>`_

+ 

+ Congratulations, you have successfully setup the development environment on your system.

+ 

+ After making changes to any file, you'll have to run the command::

+ 

+     docker-compose up --build

+ 

+ For ``docker-compose up`` or ``docker-compose up --build`` you might get an error of::

+ 

+     alpinelinux.org error ERROR: unsatisfiable constraints

+ 

+ This can be resolved by simply following the below steps

+ 

+ #. Open Docker settings.

+ #. Click on Network.

+ #. Look for 'DNS Server' section.

+ #. It is set to *Automatic* by default, change it to *fixed*.

+ #. The IP address should now be editable. Change it from ``8.8.8.8`` to ``8.8.4.4``.

+ #. Save the settings and restart Docker.

+ 

+ In order to run tests, make sure to execute ``docker-compose up`` command. Now in a new terminal(for the same container) run::

+ 

+     docker-compose exec web sh

+ 

+ Then the terminal will show a ``#`` symbol.

+ Simply type in ``t`` to initiate the test suite.

+ 

+ (The test suite are run by running the ``t`` script, which runs the tests with the appropriate testing settings and provides a coverage report.)

+ 

+ Integration tests are run via the following command::

+ 

+     manage.py test -v 2 -p integration_test*.py --settings=happinesspackets.settings.tsting

+ 

This document will make it easier for people on Windows to get started working on fedora-happiness-packets.
Refer Issue #108

Hi @phoenixabhishek, content looks great! :thumbsup: However, building the docs produces a warning:

/home/jflory/git/fedora/commops/fedora-happiness-packets/docs/setup/development_windows.rst:1: WARNING: Title overline too short.

=========================================
 Setting up a development environment on Windows
=========================================

Take a look at the Sphinx docs style guide, specifically the part about how to write headings.

Can you refactor your headings to match the format described by the style guide? This should fix the warning above too.

Metadata Update from @jflory7:
- Pull-request tagged with: PASSED, needs changes, new change, type - docs, type - summer coding
- Request assigned

2 months ago

Hi @jflory7 , I'll make the necessary changes.
Also, can you please tell me what tests gave you the error..???
Because I did execute the test-dosc.sh command, but did't get any errors.

1 new commit added

  • Fix for 'Title overline too short'
2 months ago

Hi @jflory7 , I'll make the necessary changes.

Thanks! :thumbsup:

Because I did execute the test-dosc.sh command, but did't get any errors.

I used the same script. However, I was using a Python virtual environment (venv) when I ran the script. Maybe we had different Sphinx versions. I use Pipenv to manage my dependencies (see this Fedora Magazine article for more info about using it). There is a Pipfile already inside the docs/ directory for convenient use with Pipenv.

@jflory7 the changes are done, please review.

Did you still need to run this step? The script in the repository is an executable file now, so this step should be okay to omit.

This hyperlink is formatted incorrectly. The underscore should go after the tickmark to render as a hyperlink.

Remove the whitespace between the tickmarks here. The whitespace causes these to render incorrectly instead of monospace text.

This is a nitpick, but could you place this page immediately after the other development environment page? I think it is better to keep them ordered together.

@phoenixabhishek Thanks for making the change. Everything builds successfully for me now. :thumbsup: I left some line comments with specific feedback. A few things were not rendering correctly.

1 new commit added

  • markup and spacing fixes
2 months ago

1 new commit added

  • doc sequence changed
2 months ago

@jflory7 I've made the changes.
I don't know why I messed up the hyperlink markups, I clearly did it correctly for links before it.
It was bad on my part, sorry for that. :disappointed: :disappointed: :disappointed: :disappointed: :disappointed:
I'll try to be better with proof-reading the files. :sweat_smile: :sweat_smile: :sweat_smile: :sweat_smile: :sweat_smile:

rebased onto e4a73a100d2dfae2826d98175105323668bd3652

2 months ago

Metadata Update from @jflory7:
- Pull-request untagged with: needs changes

2 months ago

@jflory7 I've made the changes.

Awesome, thanks @phoenixabhishek! :thumbsup:

Before merging this, I have a final request. Could you please rebase and squash your commits into one commit? This helps keep the git changelog tidy. If you have never rebased before, see these two articles for help:

If you need additional guidance, don't hesitate to ask for help.

It was bad on my part, sorry for that.

No worries. This is one reason we practice peer review for pull requests. It is too easy to make a mistake! :sweat_smile:

Also, for the documentation test-docs.sh script, it builds the HTML on your device like it appears on our docs website. After you run the script, you should have a folder like this: docs/_build/html. Inside that folder are the HTML pages. You can use that to proof your documentation and make sure it renders like you expect. This is how I review docs pull requests. :smile:

Sure. Thank you for the feedback.
I'll get on it right away :smile: :smile: :smile: :smile: :smile:

rebased onto 6c1e321

2 months ago

@jflory7 DONE :rocket: :rocket: :rocket: :rocket: :rocket:

@phoenixabhishek Great, thanks! :100: This is all set. Merging. :clapper:

Pull-Request has been merged by jflory7

2 months ago

@jflory7 Thank you :smiley: :smiley: :smiley: :smiley: :smiley:

@phoenixabhishek In the documentation for windows setup you have mentioned

chmod -x generate_client_secrets.sh

which makes file not executable. Rather it should be

chmod +x generate_client_secrets.sh

Could you make the necessary change in original file?

@alishapapun Thanks a lot for pointing this out.
Made PR #140 for this.
Thanks again :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: