Skip to content
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

doc: Repository structure and modules #20067

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions doc/development_process/code_flow.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/development_process/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Development Model
.. toctree::
:maxdepth: 1

repo_structure
release_process
proposals
code_flow
dev_env_and_tools
issues
api_lifecycle
Expand Down
100 changes: 100 additions & 0 deletions doc/development_process/repo_structure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. _repo-structure:

Repository structure
####################

Introduction
************

The Zephyr Project codebase was, for a long time, contained in a single `Git`_
repository. As the project evolved, it became clear that, :ref:`due to multiple
reasons <west-why-multi-repo>`, the project's code and supporting files needed
to be split out into a set of repositories instead.

To that end a new tool, :ref:`west`, was developed and introduced to ease the
Copy link
Contributor

Choose a reason for hiding this comment

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

Better would be simply, A new tool, ... (delete To that end)

burden of managing multiple Git repositories.

Structure
*********

The Zephyr Project codebase is composed of several `Git`_ repositories,
organized in a :ref:`star topology <west-topologies>` as depicted below.

.. figure:: zephyr-repos.png
:align: center
:alt: Zephyr repository structure

Zephyr repository structure

There are two types of repositories as shown by the figure:

* The `manifest repository`_ or also commonly named the "zephyr" repository
contains the `west.yml`_ :ref:`manifest file <west-manifests>` that
lists all other repositories that the manifest repository depends on.
* The project repositories are the ones containing :ref:`west projects
Copy link
Contributor

Choose a reason for hiding this comment

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

The project repositories are set in the `projects:` part of :file:`west.yml`.

They aren't contained there as much as they are the same thing, no?

Copy link
Contributor

@dbkinder dbkinder Oct 23, 2019

Choose a reason for hiding this comment

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

In @mbolivar suggested edit, use double back-ticks around projects: (not single back ticks)

<west-installation>`. Most (but not all) of those west projects are also
:ref:`modules <modules>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say Zephyr modules just to disambiguate.


All repositories are hosted under the `zephyrproject-rtos`_ GitHub organization,
since only repositories hosted under it are allowed to be featured in the
official Zephyr manifest file. This ensures that the repositories and all
referenced revisions will always be available to Zephyr users.

.. _branches:

Branches
********

Both the `manifest repository`_ and the project repositories may include the
following branches:

``master``
Which contains the latest state of development. In the case of :ref:`modules
<modules>` that fork an external project this may not reflect the latest state
of the upstream project's development, since projects are upmerged manually
when required by Zephyr itself.
Copy link
Member

Choose a reason for hiding this comment

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

Bikeshedding a bit: Maybe you want to comment that they may contain patches needed by Zephyr? (meaning they are not just behind, but are actually forked)


``topic-\*``
Topic branches that are used for shared development of a new feature

``vx.y-branch``
Branches which track maintenance releases based on a major
release

``backport-*``
Branches that are created automatically when a Pull Request is labeled to be
backported to a ``vx.y-branch``

Development in topic branches before features go to mainline allows teams to
work independently on a subsystem or a feature, improves efficiency and
turnaround time, and encourages collaboration and streamlines communication
between developers.

Changes submitted to a development topic branch can evolve and improve
incrementally in a branch, before they are submitted to the mainline tree for
final integration.

By dedicating an isolated branch to complex features, it's
possible to initiate in-depth discussions around new additions before
integrating them into the official project.

Topic branches
==============

Development topic branch owners have the following responsibilities:

- Use the infrastructure and tools provided by the project (GitHub, Git)
- Review changes coming from team members and request review from branch owners
when submitting changes.
- Keep the branch in sync with upstream and update on a regular basis.
- Push changes frequently to upstream using the following methods:

- GitHub pull requests: for example, when reviews have not been done in the local
branch (one-man branch).
Copy link
Contributor

Choose a reason for hiding this comment

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

(only one person worked on the branch)

- Merge requests: When a set of changes has been done in a local branch and
Copy link
Contributor

Choose a reason for hiding this comment

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

What is a merge request?

has been reviewed and tested in a topic branch.

.. _Git: https://git-scm.com/
.. _zephyrproject-rtos: https://github.com/zephyrproject-rtos
.. _manifest repository: https://github.com/zephyrproject-rtos/zephyr
.. _west.yml: https://github.com/zephyrproject-rtos/zephyr/blob/master/west.yml
Binary file added doc/development_process/zephyr-repos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/guides/west/repo-tool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Finally, any repository managed by a west installation can contain
provided by that project. This includes the manifest repository and any project
repository.

.. _west-topologies:

Topologies supported
********************

Expand Down
2 changes: 2 additions & 0 deletions doc/guides/west/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ examined in detail:
repositories (**R4**)
- Requires hardcoding of the paths/locations of the external repositories

.. _west-why-multi-repo:

Multiple Git Repositories
*************************

Expand Down