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

Bug sonar #2

Merged
merged 7 commits into from
Oct 22, 2023
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
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
],
plugins: [
'react',
'jsx-a11y',
'import',
],
rules: {
},
};

59 changes: 30 additions & 29 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
name: Metrics and Release

on:
pull_request:
branches:
- main
types: [closed]
pull_request:
branches:
- main
types: [closed]

jobs:
release:
if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"
release:
if: github.event.pull_request.merged == true
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Cria arquivo .env
run: |
touch ./scripts/.env
echo TOKEN=${{ secrets.API_TOKEN_GITHUB }} >> ./scripts/.env
echo RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }} >> ./scripts/.env
echo RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }} >> ./scripts/.env
- name: Create .env file
run: |
touch ./scripts/.env
echo "TOKEN=${{ secrets.API_TOKEN_GITHUB }}" >> ./scripts/.env
echo "RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }}" >> ./scripts/.env
echo "RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }}" >> ./scripts/.env

- name: Gera release e envia métricas para repositório de DOC
run: |
cd scripts && yarn install && node release.js
git config --global user.email "${{secrets.GIT_USER_EMAIL}}"
git config --global user.name "${{secrets.GIT_USER_NAME}}"
git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_GITHUB}}@github.com/fga-eps-mds/${{secrets.GIT_DOC_REPO}}" ${{secrets.GIT_DOC_REPO}}
mkdir -p ${{secrets.GIT_DOC_REPO}}/analytics-raw-data
cp -R analytics-raw-data/*.json ${{secrets.GIT_DOC_REPO}}/analytics-raw-data
cd ${{secrets.GIT_DOC_REPO}}
git add .
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}"
git pushS
- name: Generate release and send metrics to DOC repository
run: |
cd scripts && yarn install && node release.js
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git clone --single-branch --branch main "https://x-access-token:${{ secrets.API_TOKEN_GITHUB }}"@github.com/fga-eps-mds/${{ secrets.GIT_DOC_REPO}} ${{ secrets.GIT_DOC_REPO}}
mkdir -p ${{ secrets.GIT_DOC_REPO }}/analytics-raw-data
cp -R analytics-raw-data/*.json ${{ secrets.GIT_DOC_REPO }}/analytics-raw-data
cd ${{ secrets.GIT_DOC_REPO }}
git add .
git commit -m "Add metrics from repository ${{ github.event.repository.name }} ${{ github.ref_name }}"
git push
189 changes: 186 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,187 @@
# Files or folders for git ignore and maintain them localy
# Created by https://www.toptal.com/developers/gitignore/api/node,react,yarn,sonarqube
# Edit at https://www.toptal.com/developers/gitignore?templates=node,react,yarn,sonarqube

# Dependencies
/node_modules
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

### react ###
.DS_*
**/*.backup.*
**/*.back.*

node_modules

*.sublime*

psd
thumb
sketch

### SonarQube ###
# SonarQube ignore files.
#
# https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
# Sonar Scanner working directories
.sonar/
.sonarqube/
.scannerwork/

# http://www.sonarlint.org/commandline/
# SonarLint working directories, configuration files (including credentials)
.sonarlint/

### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# if you are NOT using Zero-installs, then:
# comment the following lines
!.yarn/cache

# and uncomment the following lines
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/node,react,yarn,sonarqube
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Getting Started with Create React App
# PrintGo Frontend

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fga-eps-mds_2023.2-PrintGo-FrontEnd&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=fga-eps-mds_2023.2-PrintGo-FrontEnd)

[![codecov](https://codecov.io/gh/fga-eps-mds/2023.2-PrintGo-FrontEnd/graph/badge.svg?token=Lw95zaXoXc)](https://codecov.io/gh/fga-eps-mds/2023.2-PrintGo-FrontEnd)

## Available Scripts

Expand Down
42 changes: 27 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading