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

docs: Add quick start guide #602

Merged
merged 3 commits into from
Sep 12, 2024
Merged

docs: Add quick start guide #602

merged 3 commits into from
Sep 12, 2024

Conversation

m-rudyk
Copy link
Collaborator

@m-rudyk m-rudyk commented Sep 12, 2024

Pull Request

Description

Create separate 'docker compose' for quick start with minimal setup. Update corresponding instruction easy setup and first try.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code cleanup/refactoring
  • Documentation update
  • This change requires a documentation update
  • CI system update
  • Test Coverage update

Testing

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Test Configuration:

  • Java: v17
  • LPVS Release: v1.x.x

Checklist:

  • My code follows the style guidelines of this project
  • My code meets the required code coverage for lines (90% and above)
  • My code meets the required code coverage for branches (80% and above)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@m-rudyk m-rudyk self-assigned this Sep 12, 2024
@m-rudyk m-rudyk force-pushed the m.rudyk/update_quick_guide branch from 71e4ae3 to 53d3d84 Compare September 12, 2024 06:55
Copy link
Collaborator

@o-kopysov o-kopysov left a comment

Choose a reason for hiding this comment

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

Please check my comments.

Comment on lines 5 to 12
### [Quick Start Guide](#quick-start-guide-1)

1. [Setting up your project to interact with _LPVS_](#1-setting-up-your-project-to-interact-with-lpvs)
2. [Using pre-built _LPVS_ Docker images](#2-using-pre-built-lpvs-docker-images)
3. [Setting up your project to interact with _LPVS_](#3-setting-up-your-project-to-interact-with-lpvs)

---

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please follow the style of other documentation files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines 23 to 24
> [!NOTE]
> Pay attention that the token must be copied immediately after creation, because you will not be able to see it later!!
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use note style like in other pages of the guide.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines 19 to 21
1.1 Create a personal github access token (`personal-token`):

- Follow the instructions [here](#https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) to create a personal access token with the necessary permissions.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part is already presented in the guide. Just give a link to the correct page.

Comment on lines 26 to 28
1.2 Get a personal ngrok auth token to expose your local service (`auth-token`):

- The ngrok agent authenticates with an authtoken. Your authtoken is available on the ngrok [dashboard](https://dashboard.ngrok.com/get-started/your-authtoken).
Copy link
Collaborator

Choose a reason for hiding this comment

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

This information should be placed on the page where the webhook configuration is described. Please update those page and remove this description from here.

Copy link
Collaborator Author

@m-rudyk m-rudyk Sep 12, 2024

Choose a reason for hiding this comment

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

in case of ngrok installation, we use different approach: installing token to system, and run command without auth token. If this service included in docker, we require auth token to set.

Comment on lines 39 to 40

2.1.1 Open `docker-compose.yml` file.
Copy link
Collaborator

Choose a reason for hiding this comment

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

You changed the name of the file.

Comment on lines 69 to 81
### 3. Setting up your project to interact with _LPVS_

3.1 Configure the [webhook](/doc/docs/user-guide/service/webhook.md#configure-the-webhook-in-your-github-repository-settings) in your GitHub repository settings:

- Go to `Settings` -> `Webhooks`.
- Click on `Add webhook`.
- Fill in the `Payload URL` with: `<Tunnel URL>:7896/webhooks`.
> The `Tunnel URL` can be found on localhost: `http://127.0.0.1:4040/`.
- Specify the content type as `application/json`.
- Fill in the `Secret` field with the passphrase: `LPVS`.
- Select `Let me select individual events` -> `Pull requests` (make sure only `Pull requests` is selected).
- Set the webhook to `Active`.
- Click `Add Webhook`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This description is presented in the documentation. Just place a link.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines 13 to 34
## Required if frontend and backend are different
#- frontend.main-page.url=http://localhost:3000
#- cors.allowed-origin=http://localhost:3000
## Database Configuration
- spring.datasource.url=jdbc:mysql://mysqldb:3306/lpvs
- spring.datasource.username=root
- spring.datasource.password=
- spring.jpa.properties.hibernate.default_schema=lpvs
## Github data for fetching code
- github.login=
- github.token=
- github.api.url=https://api.github.com
- github.secret=LPVS
## Google OAuth Login
- spring.security.oauth2.client.registration.google.client-id=GOOGLE_CLIENT_ID
- spring.security.oauth2.client.registration.google.client-secret=GOOGLE_CLIENT_SECRET
- spring.security.oauth2.client.registration.google.redirect-uri=http://localhost:7896/login/oauth2/code/google
- spring.security.oauth2.client.registration.google.scope=profile, email
## Github OAuth Login
- spring.security.oauth2.client.registration.github.client-id=GITHUB_CLIENT_ID
- spring.security.oauth2.client.registration.github.client-secret=GITHUB_CLIENT_SECRET
- spring.security.oauth2.client.registration.github.redirect-uri=http://localhost:7896/login/oauth2/code/github
- spring.security.oauth2.client.registration.github.scope=user
## Github Enterprise Configuration if necessary
#- spring.security.oauth2.client.provider.github.authorization-uri=https://HOSTNAME/login/oauth/authorize
#- spring.security.oauth2.client.provider.github.token-uri=https://HOSTNAME/login/oauth/access_token
#- spring.security.oauth2.client.provider.github.user-info-uri=https://HOSTNAME/api/v3/user

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove all unnecessary lines that are not used in quick start guide.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.89%. Comparing base (91fcb85) to head (58b2e31).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #602   +/-   ##
=========================================
  Coverage     93.89%   93.89%           
  Complexity      611      611           
=========================================
  Files            51       51           
  Lines          2112     2112           
  Branches        244      244           
=========================================
  Hits           1983     1983           
  Misses           57       57           
  Partials         72       72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-rudyk m-rudyk requested a review from o-kopysov September 12, 2024 09:59
@m-rudyk m-rudyk force-pushed the m.rudyk/update_quick_guide branch 2 times, most recently from e2ed1fd to 852ebaa Compare September 12, 2024 10:17
Comment on lines 1 to 5
# Quick Start Guide

---
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to the template, after the name of the section, we have to write a short sentence (brief) of the page. It will be placed at the center.

doc/mkdocs.yml Outdated
@@ -34,6 +34,7 @@ nav:
- Service mode:
- GitHub webhook configuration: user-guide/service/webhook.md
- Run service using pre-built Docker image: user-guide/service/docker.md
- Quick Start Guide: user-guide/service/quick-start-guide.md
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incorrect place. Check line 31 and replace Getting Started with Quick Start Guide.

Comment on lines +24 to +33
## Google OAuth Login
- spring.security.oauth2.client.registration.google.client-id=GOOGLE_CLIENT_ID
- spring.security.oauth2.client.registration.google.client-secret=GOOGLE_CLIENT_SECRET
- spring.security.oauth2.client.registration.google.redirect-uri=http://localhost:7896/login/oauth2/code/google
- spring.security.oauth2.client.registration.google.scope=profile, email
## Github OAuth Login
- spring.security.oauth2.client.registration.github.client-id=GITHUB_CLIENT_ID
- spring.security.oauth2.client.registration.github.client-secret=GITHUB_CLIENT_SECRET
- spring.security.oauth2.client.registration.github.redirect-uri=http://localhost:7896/login/oauth2/code/github
- spring.security.oauth2.client.registration.github.scope=user
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need this for the default profile? These options are used in Web profile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've tested solution without this part and we got error like below:
Exception in thread "main" java.lang.ClassNotFoundException: org.springframework.boot.loader.thin.ThinJarLauncher at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:138) at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:107)

I am not sure how to remove this part properly, so I tend to keep it

@@ -18,6 +18,16 @@ to create a personal access token (`personal-token`) with the necessary permissi

---

## (Optional) Configure Ngrok reverse proxy:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove ":"


---

## 1. Setting up your project to interact with _LPVS_ service
Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to remove numbers.


To enable _LPVS_ license scanning for your project, you need to set up GitHub Webhooks.

* Create a personal github access token (`personal-token`):
Copy link
Collaborator

Choose a reason for hiding this comment

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

GitHub


- Follow the instructions [here](/doc/docs/user-guide/service/webhook.md#create-a-personal-github-access-token) to create a personal access token with the necessary permissions.

!!! note
Copy link
Collaborator

Choose a reason for hiding this comment

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

!!! warning


* Get a personal ngrok auth token to expose your local service (`auth-token`):

- The ngrok agent authenticates with an authtoken. Your authtoken is available on the ngrok [dashboard](https://dashboard.ngrok.com/get-started/your-authtoken).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better to use [Ngrok portal]


## 3. Setting up your project to interact with _LPVS_

Configure the [webhook](/doc/docs/user-guide/service/webhook.md#configure-the-webhook-in-your-github-repository-settings) in your GitHub repository settings:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove ":"

Configure the [webhook](/doc/docs/user-guide/service/webhook.md#configure-the-webhook-in-your-github-repository-settings) in your GitHub repository settings:

Configuration from your project side is now complete!
You can now create a new pull request or update an existing one with commits. _LPVS_ will automatically start scanning and provide comments about the licenses found in the project.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add screenshot with the results.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image
how about this one?

Copy link
Collaborator

@o-kopysov o-kopysov Sep 12, 2024

Choose a reason for hiding this comment

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

  1. Please use white color theme
  2. Hide your account name
  3. Use new format of LPVS output

Copy link
Collaborator Author

@m-rudyk m-rudyk Sep 12, 2024

Choose a reason for hiding this comment

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

image

updated image


To configure GitHub access to a personal server, you need to expose the URL to an external API. If the server has a dedicated IP address or domain, this step can be omitted.

- Install ngrok and connect your account from [here](https://ngrok.com/docs/getting-started/#step-2-install-the-ngrok-agent) (follow steps 1 and 2).
Copy link
Collaborator

Choose a reason for hiding this comment

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

here -> Ngrok guide


- If ngrok included in docker compose, auth token can be found on [Ngrok portal](https://dashboard.ngrok.com/get-started/your-authtoken).

- Run ngrok using the command: `ngrok http 7896`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use

ngrok http 7896

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in here need clarification

Copy link
Collaborator

Choose a reason for hiding this comment

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

Use the same style of command line commands as previously.

```bash
command
```

Copy link
Collaborator

@o-kopysov o-kopysov left a comment

Choose a reason for hiding this comment

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

Please check my comments

@m-rudyk m-rudyk force-pushed the m.rudyk/update_quick_guide branch from 852ebaa to 2286214 Compare September 12, 2024 11:32
@m-rudyk m-rudyk requested a review from o-kopysov September 12, 2024 12:07
@m-rudyk m-rudyk force-pushed the m.rudyk/update_quick_guide branch from 2286214 to 8c1e73f Compare September 12, 2024 12:55
@o-kopysov o-kopysov added the documentation Improvements or additions to documentation label Sep 12, 2024
@o-kopysov o-kopysov added this to the v2.0.0 milestone Sep 12, 2024
@o-kopysov o-kopysov changed the title feat: edit quick start guide feat: Add quick start guide Sep 12, 2024
@o-kopysov o-kopysov changed the title feat: Add quick start guide docs: Add quick start guide Sep 12, 2024
Copy link
Collaborator

@o-kopysov o-kopysov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@o-konoval o-konoval left a comment

Choose a reason for hiding this comment

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

LGTM

m-rudyk and others added 3 commits September 12, 2024 20:12
Signed-off-by: Mykola Rudyk <m.rudyk@samsung.com>
Signed-off-by: Mykola Rudyk <m.rudyk@samsung.com>
Signed-off-by: Oleg Kopysov <o.kopysov@samsung.com>
@o-kopysov o-kopysov force-pushed the m.rudyk/update_quick_guide branch from b6631fa to 58b2e31 Compare September 12, 2024 17:12
@o-kopysov o-kopysov merged commit b90cc88 into main Sep 12, 2024
10 checks passed
@o-kopysov o-kopysov deleted the m.rudyk/update_quick_guide branch September 12, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants