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

Add a dead link checker for Documentation in the CI #158

Merged
merged 7 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 25 additions & 0 deletions .dlc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^http://pgp.mit.edu:11371"
},
{
"pattern": "^https://twitter.com*"
},
{
"pattern": "^http://people.apache.org/committer-index.html"
}
],
"timeout": "10s",
"retryOn429": true,
"retryCount": 10,
"fallbackRetryDelay": "1000s",
"aliveStatusCodes": [
200,
401,
403
]
}
41 changes: 41 additions & 0 deletions .github/workflows/dead-link-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Dead Link Checker

on:
pull_request:
paths:
- 'docs/**'
schedule:
- cron: '0 18 * * *' # TimeZone: UTC 0

concurrency:
group: dlc-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
CheckDeadLinks:
if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking-rover') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: sudo npm install -g [email protected]
- run: |
for file in $(find . -name "*.md"); do
markdown-link-check -c .dlc.json -q "$file"
done
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ header:
- 'licenses'
- '**/go.mod'
- '**/go.sum'
- '**/*.json'
- 'LICENSE'
- 'NOTICE'
- '.gitignore'
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Release Notes.
* Fix the base image cannot run in the arm64.

#### Documentation
* Add a dead link checker in the CI.

#### Issues and PR
- All issues are [here](https://github.com/apache/skywalking/milestone/228?closed=1)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Follow the [releases page](https://skywalking.apache.org/downloads/#SkyWalkingRo
* [bilibili B站 视频](https://space.bilibili.com/390683219)

# License
[Apache 2.0 License.](/LICENSE)
[Apache 2.0 License.](LICENSE)
38 changes: 38 additions & 0 deletions docs/en/concepts-and-designs/module_design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Module Design
## Overview

The module is an isolation concept in Rover. Each module completes an independent feature.

## Life Cycle

Each concept has a complete life cycle.

- Start: Start phase is to start the current module.
- NotifyStartSuccess: Execute when all modules have finished starting without any errors.
- Shutdown: The shutdown phase is to close all the used resources.

## Config

Each module has its corresponding configurations and only when they're set in the configuration file, the module would be enabled.

The config data support various data structures, and it could use `${ENV_NAME:DEFAULT}` to read the value from the environment variables.

## Dependency

There may have dependencies between modules.

For example, process and profiling are two separate modules, the profiling module needs to read all registered processes from the processing module. So, we could say the profiling module is dependent on the process module.

### Module API

Modules can communicate by calling APIs from dependent modules.

### Start Sequence

When Rover starts, it would analyze the dependency order of all enabled modules to a startup module list.

The startup sequence is following these steps:
1. Modules have the fewest dependent modules.
2. The position of the module declaration in the configuration file.

After parsing the list of startup modules, it would be started sequentially in a single-threaded manner.
12 changes: 6 additions & 6 deletions docs/en/guides/contribution/how-to-write-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Let's use the profiling module as an example of how to write a module.
1. Please read the [Module Design](../../concepts-and-designs/module_design.md) to understand what is module.
2. The module should be written in the **skywalking-rover/pkg** directory. So we create a new directory called profiling as the module codes space.
3. Implement the interface in the **skywalking-rover/pkg/module**. Each module has 6 methods, which are Name, RequiredModules, Config, Start, NotifyStartSuccess, and Shutdown.
- Name returns the unique name of the module, also this name is used to define in the configuration file.
- RequiredModules returns this needs depended on module names. In the profiling module, it needs to query the existing process and send snapshots to the backend, so it needs the core and process module.
- Config returns the config content of this module, which relate to the configuration file, and you could declare the tag(`mapstructure`) with the field to define the name in the configuration file.
- Start is triggered when the module needs to start. if this module start failure, please return the error.
- NotifyStartSuccess is triggered after all the active modules are Start method success.
- Shutdown
- Name returns the unique name of the module, also this name is used to define in the configuration file.
- RequiredModules returns this needs depended on module names. In the profiling module, it needs to query the existing process and send snapshots to the backend, so it needs the core and process module.
- Config returns the config content of this module, which relate to the configuration file, and you could declare the tag(`mapstructure`) with the field to define the name in the configuration file.
- Start is triggered when the module needs to start. if this module start failure, please return the error.
- NotifyStartSuccess is triggered after all the active modules are Start method success.
- Shutdown
4. Add the configuration into the **skywalking-rover/configs/rover_configs.yaml**. It should same as the config declaration.
5. Register the module into **skywalking-rover/pkg/boot/register.go**.
6. Add the Unit test or E2E testing for testing the module is works well.
Expand Down
4 changes: 0 additions & 4 deletions docs/en/setup/configuration/service-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ Each expression must return the boolean value. Otherwise, the decision throws an

The context is similar to the entity builder. Using context could help the rover understand which process could build the entity.

##### Process Context

Is the same with the [process context in scanner](./scanner.md#process), but doesn't need to add the `{{` and `}}` in prefix and suffix.

##### Pod Context

Provide current pod information and judgments.
Expand Down
Loading