-
Notifications
You must be signed in to change notification settings - Fork 0
setup CICD workflow #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| language: en-US | ||
| reviews: | ||
| profile: chill | ||
| poem: false | ||
| path_filters: [] | ||
| path_instructions: | ||
| - path: "dashboard-deployments/**" | ||
| instructions: >- | ||
| This directory contains server-side dashboard examples for visualizing data from | ||
| FixedIT Data Agent running on Axis devices. These are primarily for DevOps/IT | ||
| professionals comfortable with deploying Grafana dashboards and InfluxDB servers. | ||
| Some dashboards work directly with bundled agent configurations, others can be | ||
| customized. Licensed under Elastic License 2.0. Review for deployment complexity, | ||
| dashboard usability, and proper licensing compliance. We should make sure that | ||
| dashboards are portable and does not check in specific host names, or refer to | ||
| other specific data from a single deployment. | ||
| - path: "**/*.md" | ||
| instructions: >- | ||
| Documentation files should clearly communicate the dual audience: (1) server-side | ||
| dashboard users who want to keep agent with bundled configs, and (2) edge device | ||
| developers who want to customize agent behavior. Ensure examples and instructions | ||
| are appropriate for the intended skill level and use case. Since this is a public | ||
| repository, we should not include any sensitive information, the instructions | ||
| should be easily understandable for a wide audience, and we should avoid using | ||
| any jargon or technical terms that are not commonly used. | ||
| - path: "**/*" | ||
| instructions: >- | ||
| This repository serves FixedIT Data Agent users across a spectrum from plug-and-play | ||
| dashboard deployment to advanced edge device customization. Consider whether changes | ||
| maintain accessibility for both DevOps professionals (server-side focus) and | ||
| developers (edge customization focus). If new features are added or existing ones | ||
| changed significantly, ensure documentation clearly explains the intended audience | ||
| and usage level. We use prettier for formatting of common file formats like markdown, | ||
| yaml, json, etc. | ||
| auto_review: | ||
| enabled: true | ||
| auto_incremental_review: true | ||
| base_branches: [".*"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: Prettier Format Check | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| prettier: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| # List of files patterns that should be formatted by prettier. This should normally include: | ||
| # workflow files (yml) and any other json/yml/markdown files, including hidden config files for tools. | ||
| PRETTIER_FILES: '"**/*.{json,yml,yaml,md}" ".github/**/*.{json,yml,yaml,md}" ".*.{yml,yaml}"' | ||
| # Pin Prettier version to ensure deterministic CI runs and avoid unpredictable failures | ||
| PRETTIER_VERSION: "3.6.0" | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: Run prettier check | ||
| run: | | ||
| # Format JSON, YAML (including workflow files), and Markdown files | ||
| npx prettier@${{ env.PRETTIER_VERSION }} --check ${{ env.PRETTIER_FILES }} --ignore-unknown | ||
|
|
||
| - name: Get files that need formatting (on failure) | ||
| if: failure() && github.event_name == 'pull_request' | ||
| id: format_files | ||
| run: | | ||
| # Get list of files that need formatting | ||
| FILES_NEEDING_FORMAT=$(npx prettier@${{ env.PRETTIER_VERSION }} --check ${{ env.PRETTIER_FILES }} --ignore-unknown --list-different 2>/dev/null || true) | ||
| echo "files_list<<EOF" >> $GITHUB_OUTPUT | ||
| echo "$FILES_NEEDING_FORMAT" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Comment on PR (on failure) | ||
| if: failure() && github.event_name == 'pull_request' && steps.format_files.outputs.files_list != '' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const filesList = `${{ steps.format_files.outputs.files_list }}`.trim(); | ||
|
|
||
| if (filesList) { | ||
| const files = filesList.split('\n').filter(f => f.trim()); | ||
| const comment = `## 🎨 Code Formatting Required | ||
|
|
||
| Some files in this PR need to be formatted with Prettier. | ||
|
|
||
| This includes JSON, YAML (workflow files), and Markdown files. | ||
|
|
||
| **Files that need formatting:** | ||
| ${files.map(file => `- \`${file}\``).join('\n')} | ||
|
|
||
| **To fix this:** | ||
| 1. Format the files: \`npx prettier@${{ env.PRETTIER_VERSION }} --write ${{ env.PRETTIER_FILES }} --ignore-unknown\` | ||
| 2. Commit and push the changes | ||
|
|
||
| The formatting check will automatically pass once these files are properly formatted.`; | ||
|
|
||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: comment | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| # fixedit-data-agent-dashboards | ||
|
|
||
| This repository contains an InfluxDB + Grafana stack with provisioned dashboards for Axis camera monitoring with the FixedIT Data Agent edge application. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.