Unexpected symbol: ‘2e4ce68d4e3feec97e992821e6391166943f4d49’ - sonarcloud

I tried to built github .yml file but I’m getting error like
|GitHub Actions/ Main Workflow
Invalid workflow file
The workflow is not valid. .github/workflows/build.yml (Line: 22, Col: 22): Unexpected symbol: '<hash_value>'. Located at position 9 within expression: secrets.<hash_value>|
CODE
on:
Trigger analysis when pushing in master or pull requests, and when creating
a pull request.
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
name: Main Workflow
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action#v1.3
env:
GITHUB_TOKEN: {{ secrets.<hash_value>}} SONAR_TOKEN: {{ secrets.<hash_value>}}
AND
#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=https://sonarcloud.io/
#----- Default source code encoding
#sonar.sourceEncoding=UTF-8
sonar.organization=blah blah
sonar.projectKey=blah blah
— optional properties —
defaults to project key
sonar.projectName=Toolsdemo
defaults to ‘not provided’
sonar.projectVersion=1.0
Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=https://github.com/abcd/xyz
Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
Please help . I need to test my code very fast .

Related

when refreshing, it returning The resource you are looking for has been removed, had its name changed, or is temporarily unavailable

I deployed a Nuxt 3 website as a classic SPA since I don't need SSR for my project. Used nuxt generate and deployed the contents from .output/public/ in Azure static web app. It is successfully running now, but when I'm accessing pages with dynamic routes like user/[id] and hit refresh the page, I'm getting this message:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
nuxt.config.ts
export default defineNuxtConfig({
ssr: false,
});
I'm just really new on Nuxt and in Vue world will appreciate any help guys.
I have followed the MSDoc and able to run the Nuxt JS app without any issues.
Make sure you have followed the same steps as below.
Navigate to the GitHub and create a new repository from nuxt-3-starter.
New repo with code will be generated.
In Azure Portal, create a new Static Web App.
Select the GitHub and provide the Repository and branch details as shown below.
We can also check the Workflow file.
My Workflow:
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout#v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy#v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_PLANT_0E617661E }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: ".output/server"
output_location: ".output/public" # Built app content directory
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy#v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_PLANT_0E617661E }}
action: "close"
Make sure the build and deployment are successful. We can check it in GitHub Repository => Actions.
Click on the Workflow file, you can see the Jobs Status.
OutPut:
With dynamic routes - user/[id]
Please Check the code in my GitHub Repository.

reference a variable in serverless framework

I'm trying to define my serverless framework deployment bucket.
My serverless.yml looks like this:
provider:
name: aws
runtime: nodejs14.x
region: us-east-1
stage: dev
deploymentBucket:
name: ${self:environment.DEPLOYMENT_BUCKET}
environment:
${file(../evn.${opt:stage, 'dev'}.json)}
and the evn.dev.json file looks like this:
{
"DEPLOYMENT_BUCKET": "myBucketName"
}
(both of these files have non-relevant parts removed)
I'm getting a "cannot resolve variable at "provicer.deploymentBucket.name" error when trying to deploy.
How do I reference the DEPLOYMENT_BUCKET variable in the serverless.yml file?
EDIT: Other errors:
${environment}:DEPLOYMENT_BUCKET -> Could not locate deployment bucket. Error: The specified bucket is not valid
name: ${environment:DEPLOYMENT_BUCKET}1 -> Unrecognized configuration variable sources: "environment"
name: ${self:provider.environment:DEPLOYMENT_BUCKET}
and
name: ${self:environment:DEPLOYMENT_BUCKET}
-> Cannot resolve serverless.yml: Variables resolution errored with - Cannot resolve variable at "provider.deploymentBucket.name": Value not found at "self" source
I was able to solve the problem with this:
${file(../evn.${opt:stage, 'dev'}.json):DEPLOYMENT_BUCKET}
But 'reading' that file twice -- both here and in the 'environment' area seems to somewhat defeat the purpose of the environments area.

dbt found two resources with the same name

I'm hitting a strange error in dbt
I am using the following package to enable external tables in bigquery.
packages:
- package: dbt-labs/dbt_external_tables
version: 0.8.0
$ dbt run-operation stage_external_sources
An error occurred in the dbt Server. Please contact support if this issue persists.
RPC server failed to compile project, call the "status" method for compile status: Compilation Error
dbt found two resources with the name
"dbt_user_test_ext". Since these resources have the same name, dbt will be unable to find the correct resource when source("dbt_user", "test_ext") is used. To fix this change the name of one of these resources:
source.dbt_user.test_ext (models/sources.yml)
source.dbt_user.test_ext (models/sources.yml) Code: 10011
models/sources.yml looks something like this:
sources:
- name: "{{ target.schema }}"
tables:
- name: test_ext
external:
location: "gs://test-bucket/test_ext.csv"
options:
format: csv
skip_leading_rows: 1
Seems to only happen the after the first time I run the command.
Question: what am I doing wrong, and/or how to fix?

DBT problem with yml file: Profile my-bigquery-db in profiles.yml is empty

I am doing the DBT hello world tutorial found here, and I have created my first project on a windows machine. My profiles.yml file looks like this:
my-bigquery-db:
target: dev
outputs:
dev:
type: bigquery
method: service-account
project: abiding-operand-286102
dataset: xxxDBTtestO1
threads: 1
keyfile: C:\Users\xxx\.dbt\abiding-operand-286102-ed9e3c9c13cd.json
timeout_seconds: 300
when I execute dbt run I get:
Running with dbt=0.17.2 Encountered an error while reading profiles: ERROR Runtime Error
dbt encountered an error while trying to read your profiles.yml
file.
Profile my-bigquery-db in profiles.yml is empty
Defined profiles:
my-bigquery-db
target
outputs
dev
type
method
project
dataset
threads
keyfile
timeout_seconds
Any idea?
At first glance from both your code and the source walkthrough, this is just a yml config problem. YML is a markup language that is white-space sensitive. And by just looking at the example that you may have pulled from - it doesn't look appropriately white spaced to me.
I'm not sure if you can simply copy from the below but it might be worth a shot.
my-bigquery-db:
target: dev
outputs:
dev:
type: bigquery
method: service-account
project: abiding-operand-286102
dataset: xxxDBTtestO1
threads: 1
keyfile: C:\Users\xxx\.dbt\abiding-operand-286102-ed9e3c9c13cd.json
timeout_seconds: 300
Basically - your dbt profile.yml needs to be setup with the sections at certain levels (not unlike python indentation or any other white spacing scheme).

Serverless: Importing file to custom + other variables

I have a serverless.common.yml, with properties that should be shared by all the services, with that:
service: ixxxx
custom:
stage: ${opt:stage, self:provider.stage}
resourcesStages:
prod: prod
dev: dev
resourcesStage: ${self:custom.resourcesStages.${self:custom.stage}, self:custom.resourcesStages.dev}
lambdaPolicyXRay:
Effect: Allow
Action:
- xray:PutTraceSegments
- xray:PutTelemetryRecords
Resource: "*"
And, another serverless.yml inside a services folder, which uses properties on the common file:
...
custom: ${file(../../serverless.common.yml):custom}
...
environment:
stage: ${self:custom.stage}
...
In that way, I can access the custom variables (from the common file) without a problem.
Now, I want to continue to import this file to custom, but adding new variables, related to this service, to it, so I tried that:
custom:
common: ${file(../../serverless.common.yml):custom}
wsgi:
app: app.app
packRequirements: false
pythonRequirements:
dockerizePip: non-linux
And it seems it's possible to access, for example:
environment:
stage: ${self:custom.common.stage}
But now, I'm receiving the error:
Serverless Warning --------------------------------------
A valid service attribute to satisfy the declaration 'self:custom.stage' could not be found.
Serverless Warning --------------------------------------
A valid service attribute to satisfy the declaration 'self:custom.stage' could not be found.
Serverless Error ---------------------------------------
Trying to populate non string value into a string for variable ${self:custom.stage}. Please make sure the value of the property is a strin
What am I doing wrong?
In your serverless.common.yml you must reference as if it were serverless.yml. In this case ${self:custom.stage} does not exist, but ${self:custom.common.stage} does exist.
service: ixxxx
custom:
stage: ${opt:stage, self:provider.stage}
resourcesStages:
prod: prod
dev: dev
resourcesStage: ${self:custom.common.resourcesStages.${self:custom.common.stage}, self:custom.resourcesStages.dev}
lambdaPolicyXRay:
Effect: Allow
Action:
- xray:PutTraceSegments
- xray:PutTelemetryRecords
Resource: "*"