Skip to content

Commit 3ddef10

Browse files
committed
chore(docs): adjust a few sections + include mkdocs features
1 parent 5e644e6 commit 3ddef10

23 files changed

+898
-695
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Thank you for your interest in contributing to our project! We appreciate all co
1414
- Create a [:bust_in_silhouette: User Story](https://github.com/DIRACGrid/diracx-web/discussions/categories/user-personas-and-stories) to describe your need and share your design ideas if any.
1515

1616
- **Want to contribute to the :computer: codebase?**
17-
- Read the [:book: Developer Guide](docs/developer/index.md) to set up your environment and get started.
17+
- Read the [:book: Developer Guide](docs/dev/how-to/contribute.md) to set up your environment and get started.

docs/admin/deploy_instance.md

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Deploying the web interface
2+
## DiracX-Web
3+
4+
### Development mode
5+
6+
Refer to the [Developer Guide: Getting Started](../../dev/tutorials/getting_started.md) for instructions on running `diracx-web` in development mode.
7+
8+
### Production mode
9+
10+
To deploy `diracx-web` in a production environment, you need to customize the [`diracx` Helm Chart](https://github.com/DIRACGrid/diracx-charts) values. Key parameters include:
11+
12+
```yaml title="Helm Chart values for production deployment"
13+
global.images.web.tag: <latest diracx-web version, docker tag>
14+
global.images.web.repository: <diracx-web docker image>
15+
```
16+
17+
!!! tip "Version Configuration"
18+
Make sure to update these values to point to the appropriate Docker image and version for your deployment.
19+
20+
### Integrating new features/hotfixes
21+
22+
=== "Testing Features"
23+
24+
To hotfix `diracx-web` or test new features, you can provide a specific PR within [`diracx` Helm Chart](https://github.com/DIRACGrid/diracx-charts) values, such as:
25+
26+
```yaml title="Helm Chart values for feature testing"
27+
diracxWeb.repoURL: <repository hosting the branch you want to apply>
28+
diracxWeb.branch: <branch hosting the changes you want to apply>
29+
```
30+
31+
=== "Production Hotfixes"
32+
33+
For urgent production hotfixes:
34+
35+
1. Create a hotfix branch from the production release
36+
2. Apply the minimal fix required
37+
3. Test thoroughly in a staging environment
38+
4. Update the Helm Chart values to point to the hotfix image
39+
40+
!!! warning "Deployment Safety"
41+
Always test changes in a staging environment before applying to production.
42+
43+
## Extension
44+
45+
46+
### `gubbins` extension in development mode
47+
48+
For managing the `gubbins` extension in development mode, refer to the [Developer Guide: Managing an extension](../../dev/how-to/manage_extension.md).
49+
50+
### `gubbins` extension in development mode, as a standalone
51+
52+
By default, the `gubbins` extension is part of a monorepo and uses a local version of `diracx-web-components`. This setup is not representative of a standalone extension configuration.
53+
54+
To deploy gubbins as a standalone package:
55+
- **Isolate the `packages/extensions` directory:** Copy the content of `packages/extensions` to a new repository or directory outside the monorepo.
56+
- **Update Configuration:** Adjust relevant variables to align with a standalone setup. Review the gubbins-test GitHub Action workflow for required changes.

docs/admin/how-to/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Administrator How-To Guides
2+
3+
This section provides guides for administrators managing DiracX Web deployments and infrastructure.
4+
5+
## Available Guides
6+
7+
!!! info "Deployment Guide"
8+
Start with the [Deployment Guide](../deploy_instance.md) for setting up DiracX Web in production.
9+
10+
=== "Deployment & Operations"
11+
12+
**[Deploy Instance](../deploy_instance.md)**
13+
: Complete guide for deploying DiracX Web in production environments.
14+
15+
=== "Maintenance"
16+
17+
**[Manage Dependencies](../manage_dependencies.md)**
18+
: Learn how to handle dependency updates and security vulnerabilities.
19+
20+
**[Manage Releases](../manage_release.md)**
21+
: Guide for managing DiracX Web releases and versioning.
22+
23+
## Best Practices
24+
25+
!!! tip "Production Checklist"
26+
- Always test in staging before deploying to production
27+
- Monitor application performance and logs
28+
- Keep dependencies updated for security
29+
- Maintain proper backup procedures
30+
31+
!!! warning "Security Considerations"
32+
Regularly review and apply security updates. Enable automated security alerts in your GitHub repository settings.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Managing web dependencies
2+
3+
## Updating dependencies
4+
5+
[Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates) is a GitHub-integrated tool that automates dependency management by regularly checking for updates and creating pull requests (PRs) to keep your project's dependencies current.
6+
7+
!!! info "Weekly Schedule"
8+
In the `diracx-web` repository, Dependabot is configured to run weekly, generating PRs for any outdated or vulnerable dependencies.
9+
10+
=== "Review PRs"
11+
12+
**Access PRs**
13+
: Navigate to the repository's "Pull Requests" section to view Dependabot's submissions.
14+
15+
**Examine Changes**
16+
: Assess the proposed updates, paying close attention to any major version changes that might introduce breaking changes.
17+
18+
=== "Verify Tests"
19+
20+
**Automated Tests**
21+
: Ensure that all continuous integration (CI) checks and automated tests pass successfully for each Dependabot PR.
22+
23+
**Handle Failures**
24+
: If tests fail, investigate the cause by reviewing the dependency's changelog or release notes to identify any breaking changes or incompatibilities.
25+
26+
=== "Adapt Code"
27+
28+
**Local Development**
29+
: ```bash title="Working with Dependabot branches"
30+
# Check out the PR branch locally
31+
git checkout dependabot/branch-name
32+
33+
# Run tests locally
34+
npm test
35+
36+
# Make necessary fixes
37+
# ... edit code ...
38+
39+
# Test your changes
40+
npm run test:diracx-web-components
41+
npm run --prefix packages/diracx-web test
42+
```
43+
44+
**Implement Fixes**
45+
: Modify the codebase to address any issues introduced by the dependency update.
46+
47+
=== "Merge & Monitor"
48+
49+
**Final Review**
50+
: Once tests pass and the codebase is stable, proceed to merge the PR into the main branch.
51+
52+
**Post-Merge Actions**
53+
: Monitor the application post-deployment to ensure that the update does not introduce any unforeseen issues.
54+
55+
!!! warning "Deployment Monitoring"
56+
Keep a close eye on the application after dependency updates to catch any unexpected issues early.
57+
58+
## Managing Security Vulnerabilities
59+
60+
Dependabot also helps in identifying and addressing security vulnerabilities in your project's dependencies. When a vulnerability is detected, Dependabot generates alerts and can automatically create PRs to update the affected dependencies.
61+
62+
!!! danger "Security Alert Process"
63+
Navigate to the repository's **"Security"** tab and select **"Dependabot alerts"** to view any security vulnerabilities identified in the dependencies.
64+
65+
**Priority Levels:**
66+
67+
- **Critical**: Immediate action required
68+
- **High**: Address within 1 week
69+
- **Medium**: Address within 1 month
70+
- **Low**: Address during next maintenance cycle
71+
72+
!!! tip "Proactive Security"
73+
Enable GitHub's security alerts and automatic security updates for immediate notification of vulnerabilities in your dependencies.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Release Management
1+
# Managing web releases
22

33
```mermaid
44
sequenceDiagram

docs/admin/manage_dependencies.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
2-
# Developer Guide
3-
4-
Welcome to the DiracX-Web Developer Guide! This guide will help you navigate and ramp you up. Adding features, fixing the code in a consistent manner with tests and documentation will become a second nature.
5-
6-
7-
## Architecture Overview
1+
# Web architecture Overview
82

93
```mermaid
104
---
@@ -38,17 +32,23 @@ flowchart TD
3832

3933
This repository is organized as a monorepo, with the following key packages:
4034

41-
- [**DiracX-Web-Components**](packages/diracx-web-components): A library of reusable React components designed for integration within the `DiracX-Web` package and to facilitate the creation of custom DiracX web extensions.
35+
=== "DiracX-Web-Components"
4236

43-
- [**DiracX-Web**](packages/diracx-web): Vanilla Dirac web interface based on Next.js. Leverages components from `DiracX-Web-Components` to provide core functionalities.
37+
**Purpose**: A library of reusable React components
38+
**Location**: `packages/diracx-web-components`
39+
**Description**: Designed for integration within the `DiracX-Web` package and to facilitate the creation of custom DiracX web extensions.
4440

45-
- [**Extensions**](packages/extensions): An illustrative example of a web extension, also based on Next.js, demonstrating how to extend the functionality of `DiracX-Web` using the components from the `DiracX-Web-Components` package.
41+
=== "DiracX-Web"
4642

43+
**Purpose**: Main web application
44+
**Location**: `packages/diracx-web`
45+
**Description**: Vanilla Dirac web interface based on Next.js. Leverages components from `DiracX-Web-Components` to provide core functionalities.
4746

48-
The monorepo structure is based on *npm workspaces* to ensure that related packages ([DiracX-Web-Components](packages/diracx-web-components)) are automatically used from their local versions instead of fetching them from the npm registry.
47+
=== "Extensions"
4948

50-
## Ramping up
49+
**Purpose**: Example extension implementation
50+
**Location**: `packages/extensions`
51+
**Description**: An illustrative example of a web extension, also based on Next.js, demonstrating how to extend the functionality of `DiracX-Web` using the components from the `DiracX-Web-Components` package.
5152

52-
- [Set up a development environment](setup_environment.md)
53-
- [Manage the extension](manage_extension.md)
54-
- [Contribute to the effort](../developer/contribute.md)
53+
!!! info "Monorepo Structure"
54+
The monorepo structure is based on *npm workspaces* to ensure that related packages ([DiracX-Web-Components](packages/diracx-web-components)) are automatically used from their local versions instead of fetching them from the npm registry.

docs/dev/how-to/contribute.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Contributing to DiracX-Web
2+
3+
### 1. Open an Issue
4+
5+
!!! tip "Discussion First"
6+
Before making a pull request (PR), especially for non-trivial changes, please [open an issue](https://github.com/DIRACGrid/diracx-web/issues) to discuss your idea. This ensures that everyone is aligned on the proposed change.
7+
8+
!!! info "Check Existing Issues"
9+
Before opening a new issue, please check if a similar issue already exists. If a similar issue exists, consider contributing to the discussion there instead.
10+
11+
!!! success "Good First Issues"
12+
If you want to start contributing right away, check out the issues labeled with ["good first issue"](https://github.com/DIRACGrid/diracx-web/labels/good%20first%20issue). These are issues that are well-suited for newcomers to the project.
13+
14+
### 2. Make Changes
15+
16+
!!! info "Requirements"
17+
[Getting Started](../tutorials/getting_started.md)
18+
19+
=== "Repository Setup"
20+
21+
**Fork the Repository**
22+
: Start by forking the repository and creating a new branch for your work. Use a descriptive name for your branch that reflects the work you are doing.
23+
24+
=== "Documentation"
25+
26+
**Code Documentation**
27+
: Ensure that any code you write is well-documented. This includes:
28+
29+
- Inline comments where necessary to explain complex logic
30+
- Updating or creating Storybook documentation if you are contributing to the `diracx-web-components` library
31+
- You can use tools like [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/) to maintain code quality
32+
33+
=== "Testing"
34+
35+
**Component Testing**
36+
: Write tests for your stories to ensure they work as expected. Use [Jest](https://jestjs.io/) for unit testing and snapshot testing of your React components.
37+
38+
**Application Testing**
39+
: Use [Cypress](https://www.cypress.io/) for end-to-end testing to simulate real user interactions and ensure your application behaves correctly.
40+
41+
**Test Coverage**
42+
: Maintain good test coverage to ensure that your critical features are well-protected during updates. Tools like Jest provide [coverage reports](https://jestjs.io/docs/code-coverage) that help you identify untested parts of your code.
43+
44+
=== "Accessibility"
45+
46+
**Inclusive Design**
47+
: Make your application accessible to all users. Use semantic HTML, ARIA attributes, and test your application with different screen sizes and assistive technologies.
48+
49+
!!! tip "Component Exports"
50+
If you create an export function or component in `diracx-web-components`, you must add it to the `index.ts` file and run `npm run build` inside `packages/diracx-web-components` to ensure the pre-commit hook passes.
51+
52+
!!! warning "Breaking Changes"
53+
Don't forget to update the `packages/extensions` code if you integrate breaking changes in the `diracx-web-components` library. See [Managing the extension](manage_extension.md) for further details.
54+
55+
### 3. Commit
56+
57+
!!! info "Conventional Commits Required"
58+
All commits must follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. This ensures that commit messages are structured and consistent, which is important for automation and versioning.
59+
60+
**Examples:**
61+
```
62+
feat(ui): add new button component
63+
fix(api): handle null values in response
64+
docs(readme): update contributing guidelines
65+
```
66+
67+
!!! danger "CI Requirement"
68+
If your commit messages do not follow this convention, the Continuous Integration (CI) process will fail, and your PR will not be merged. Please ensure your commit messages are properly formatted before pushing.
69+
70+
!!! note "Pre-commit Hooks"
71+
`Husky` is configured to run as a pre-commit script, executing tasks such as linting staged files to maintain code consistency with the codebase.
72+
73+
74+
### 4. Make a Pull Request (PR)
75+
76+
- **Submit Your PR:** When you’re ready, submit your pull request. Please include a clear description of what your PR does and reference the issue number it addresses (if applicable).
77+
- **Review Process:** Your PR will be reviewed by project maintainers. Please be patient and responsive to any feedback you receive.
78+
79+
### 5. Additional Notes
80+
81+
- **Trivial Changes:** For minor changes like fixing typos, feel free to skip the issue creation step and go straight to making a PR.
82+
- **Stay Up-to-Date:** Make sure your branch is up-to-date with the latest changes in the main branch before submitting your PR. Use `git rebase` if necessary.

0 commit comments

Comments
 (0)