Skip to content

Commit

Permalink
#59 - Apply brainstorming vision (#61)
Browse files Browse the repository at this point in the history
* #59 - Apply brainstorming vision
- Update README.md file to better explain term documentation issue.
- Create VISION.md to show and shortly describe future vision.
- Reworded usage of work issue to ticket.
  • Loading branch information
miroslavpojer authored Nov 4, 2024
1 parent 77d7078 commit 49c62ed
Show file tree
Hide file tree
Showing 3 changed files with 319 additions and 1 deletion.
78 changes: 77 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- [Expected Output](#expected-output)
- [Index page example](#index-page-example)
- [Issue page example](#issue-page-example)
- [Documentation Ticket Introduction](#documentation-ticket-introduction)
- [Labels](#labels)
- [Hosting Documentation Tickets in a Solo Repository](#hosting-documentation-tickets-in-a-solo-repository)
- [Project Setup](#project-setup)
- [Run Scripts Locally](#run-scripts-locally)
- [Run Pylint Check Locally](#run-pylint-check-locally)
Expand All @@ -28,13 +31,18 @@
- [License Information](#license-information)
- [Contact or Support Information](#contact-or-support-information)

A tool designed to data-mine GitHub repositories for issues containing project documentation (e.g. tagged with feature-related labels). This tool automatically generates comprehensive living documentation in Markdown format, providing detailed feature overview pages and in-depth feature descriptions.
![vision.jpg](img/vision.jpg)

A tool designed to data-mine GitHub repositories for [documentation tickets](#documentation-ticket-introduction) containing project documentation (e.g. tagged with feature-related labels). This tool automatically generates comprehensive living documentation in Markdown format, providing detailed feature overview pages and in-depth feature descriptions.

## Motivation

Addresses the need for continuously updated documentation accessible to all team members and stakeholders. Achieves this by extracting information directly from GitHub issues and integrating this functionality to deliver real-time, markdown-formatted output. Ensures everyone has the most current project details, fostering better communication and efficiency throughout development.

## Usage

### Prerequisites

Before we begin, ensure you have a GitHub Token with permission to fetch repository data such as Issues and Pull Requests.

### Adding the Action to Your Workflow
Expand Down Expand Up @@ -115,9 +123,11 @@ See the full example of action step definition (in example are used non-default
```
## Action Configuration
Configure the action by customizing the following parameters based on your needs:
### Environment Variables
- **LIV_DOC_ACCESS_TOKEN** (required):
- **Description**: GitHub access token for authentication, that has a permission to fetch from requested repositories.
- **Usage**: Store it in the GitHub repository secrets and reference it in the workflow file using `${{ secrets.LIV_DOC_ACCESS_TOKEN }}`.
Expand All @@ -128,6 +138,7 @@ Configure the action by customizing the following parameters based on your needs
```

#### How to Create a Token with Required Scope

1. Go to your GitHub account settings.
2. Click on the `Developer settings` tab in the left sidebar.
3. In the left sidebar, click on `Personal access tokens` and choose `Tokens (classic)`.
Expand Down Expand Up @@ -155,13 +166,15 @@ Configure the action by customizing the following parameters based on your needs
8. Authorize new token to organization you want to fetch from.

#### How to Store Token as a Secret

1. Go to the GitHub repository, from which you want to run the GitHub Action.
2. Click on the `Settings` tab in the top bar.
3. In the left sidebar, click on `Secrets and variables` > `Actions`.
4. Click on the `New repository secret` button.
5. Name the token `LIV_DOC_ACCESS_TOKEN` and paste the token value.

### Inputs

- **repositories** (required)
- **Description**: A JSON string defining the repositories to be included in the documentation generation.
- **Usage**: List each repository with its organization name, repository name, query labels and attached projects you want to filter if any. Only projects with these titles will be considered. For no filtering projects, leave the list empty.
Expand Down Expand Up @@ -191,6 +204,7 @@ Configure the action by customizing the following parameters based on your needs
```

### Features De/Activation

- **project-state-mining** (optional, `default: false`)
- **Description**: Enables or disables the mining of project state data from [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects).
- **Usage**: Set to true to activate.
Expand Down Expand Up @@ -219,6 +233,7 @@ Configure the action by customizing the following parameters based on your needs
```

## Action Outputs

The Living Documentation Generator action provides a key output that allows users to locate and access the generated documentation easily. This output can be utilized in various ways within your CI/CD pipeline to ensure the documentation is effectively distributed and accessible.
The output-path can not be an empty string. It can not aim to the root and other project directories as well.

Expand All @@ -235,10 +250,12 @@ The output-path can not be an empty string. It can not aim to the root and other
```

## Expected Output

The Living Documentation Generator is designed to produce an Issue Summary page (index.md) along with multiple detailed single issue pages.

### Index Page Example


```markdown
# Issue Summary page
Expand Down Expand Up @@ -287,25 +304,70 @@ Users often struggle to find specific books in a large catalog. An advanced sear
...
```

## Documentation Ticket Introduction

A **Documentation Ticket** is a small piece of documentation realised as GitHub Issue dedicated to project documentation. Unlike development-focused tickets, Documentation Ticket remain open continuously, evolving as updates are needed, and can be reopened or revised indefinitely. They are not directly tied to Pull Requests (PRs) but can be referenced for context.

- **Content Rules**:
- **Non-technical Focus:**
- Keep the documentation body free of technical solution specifics.
- Technical insights should be accessible through linked PRs or Tickets within the development repository.
- **Independent Documentation:**
- Ensure the content remains independent of implementation details to allow a clear, high-level view of the feature or user story's purpose and functionality.

### Labels

To enhance clarity, the following label groups define and categorize each Documentation Issue:
- **Topic**:
- **{Name}Topic:** Designates the main focus area or theme relevant to the ticket, assigned by the editor for consistency across related documentation.
- Examples: `ReportingTopic`, `UserManagementTopic`, `SecurityTopic`.
- **noTopic:** Indicates that the ticket does not align with a specific topic, based on the editor's discretion.
- **Type**:
- **DocumentedUserStory:** Describes a user-centric functionality or process, highlighting its purpose and value.
- Encompasses multiple features, capturing the broader goal from a user perspective.
- **DocumentedFeature:** Details a specific feature, providing a breakdown of its components and intended outcomes.
- Built from various requirements and can relate to multiple User Stories, offering an in-depth look at functionality.
- **DocumentedRequirement:** Outlines individual requirements or enhancements tied to the feature or user story.
- **Issue States**:
- **Upcoming:** The feature, story, or requirement is planned but not yet implemented.
- **Implemented:** The feature or requirement has been completed and is in active use.
- **Deprecated:** The feature or requirement has been phased out or replaced and is no longer supported.

**DocumentedUserStory** and **DocumentedFeature** serve as **Epics**, whereas **DocumentedRequirement** represents specific items similar to feature enhancements or individual requirements.

### Hosting Documentation Tickets in a Solo Repository

Using a dedicated repository solely for documentation tickets provides multiple advantages:
- **Streamlined Management:** This avoids cross-project conflicts and board exclusions and enables specialized templates solely for documentation purposes.
- **Focused Access Control:** This allows a small team to manage and edit documentation without interference, maintaining high-quality content.
- **Optimized Data Mining:** Supports easier and more efficient data extraction for feedback and review cycles through Release Notes.
- **Implementation Reflection:** Mirrors elements from the implementation repositories, providing a high-level knowledge source that is valuable for both business and technical teams.
- **Release Notes Integration:** Documentation can evolve based on insights from release notes, serving as a dynamic feedback loop back to the documentation repository.

## Project Setup

If you need to build the action locally, follow these steps:

### Prepare the Environment

```shell
python3 --version
```

### Set Up Python Environment

```shell
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

## Run Scripts Locally

If you need to run the scripts locally, follow these steps:

### Create the Shell Script

Create the shell file in the root directory. We will use `run_script.sh`.
```shell
touch run_script.sh
Expand All @@ -316,6 +378,7 @@ Add the shebang line at the top of the sh script file.
```
### Set the Environment Variables
Set the configuration environment variables in the shell script following the structure below.
Also make sure that the INPUT_GITHUB_TOKEN is configured in your environment variables.
INPUT_OUTPUT_PATH can not be an empty string. It can not aim to the root and other project directories as well.
Expand All @@ -335,6 +398,7 @@ export INPUT_VERBOSE_LOGGING="true"
```
### Running the script locally
For running the GitHub action incorporate these commands into the shell script and save it.
```
cd src || exit 1
Expand All @@ -345,17 +409,20 @@ cd .. || exit 1
```
### Make the Script Executable
From the terminal that is in the root of this project, make the script executable:
```shell
chmod +x run_script.sh
```

### Run the Script

```shell
./run_script.sh
```

## Run Pylint Check Locally

This project uses [Pylint](https://pypi.org/project/pylint/) tool for static code analysis.
Pylint analyses your code without actually running it.
It checks for errors, enforces, coding standards, looks for code smells etc.
Expand All @@ -367,6 +434,7 @@ We are aiming to keep our code quality high above the score 9.5.
Follow these steps to run Pylint check locally:

### Set Up Python Environment

From terminal in the root of the project, run the following command:

```shell
Expand All @@ -378,6 +446,7 @@ pip install -r requirements.txt
This command will also install a Pylint tool, since it is listed in the project requirements.

### Run Pylint

Run Pylint on all files that are currently tracked by Git in the project.
```shell
pylint $(git ls-files '*.py')
Expand All @@ -391,6 +460,7 @@ pylint living_documentation_generator/generator.py
```

### Expected Output

This is the console expected output example after running the tool:
```
************* Module main
Expand All @@ -401,6 +471,7 @@ Your code has been rated at 9.41/10 (previous run: 8.82/10, +0.59)
```

## Run Black Tool Locally

This project uses the [Black](https://github.com/psf/black) tool for code formatting.
Black aims for consistency, generality, readability and reducing git diffs.
The coding style used can be viewed as a strict subset of PEP 8.
Expand All @@ -412,6 +483,7 @@ We also do exclude the `tests/` file from the black formatting.
Follow these steps to format your code with Black locally:

### Set Up Python Environment

From terminal in the root of the project, run the following command:

```shell
Expand All @@ -423,6 +495,7 @@ pip install -r requirements.txt
This command will also install a Black tool, since it is listed in the project requirements.

### Run Black

Run Black on all files that are currently tracked by Git in the project.
```shell
black $(git ls-files '*.py')
Expand All @@ -436,6 +509,7 @@ black living_documentation_generator/generator.py
```

### Expected Output

This is the console expected output example after running the tool:
```
All done! ✨ 🍰 ✨
Expand Down Expand Up @@ -473,6 +547,7 @@ htmlcov/index.html
```

## Deployment

This project uses GitHub Actions for deployment draft creation. The deployment process is semi-automated by a workflow defined in `.github/workflows/release_draft.yml`.

- **Trigger the workflow**: The `release_draft.yml` workflow is triggered on workflow_dispatch.
Expand Down Expand Up @@ -538,6 +613,7 @@ This feature allows you to generate structured output for the living documentati
We welcome contributions to the Living Documentation Generator! Whether you're fixing bugs, improving documentation, or proposing new features, your help is appreciated.

#### How to Contribute

Before contributing, please review our [contribution guidelines](https://github.com/AbsaOSS/living-doc-generator/blob/master/CONTRIBUTING.md) for more detailed information.

### License Information
Expand Down
Loading

0 comments on commit 49c62ed

Please sign in to comment.