Compare commits

..

5 commits

Author SHA1 Message Date
GitHub Action
f62c145389 Increment frontend chart version to v1.22.39 2025-05-29 09:45:04 +00:00
rjshrjndrn
8d6b57b5f9 fix: move cd - command after git operations in patch workflow
Move the directory restoration command after the git operations to
ensure all git commands execute in the correct working directory
before returning to the previous directory.

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2025-05-29 11:43:04 +02:00
rjshrjndrn
e380cc09d6 tmp:remove
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2025-05-29 11:33:24 +02:00
rjshrjndrn
c87994440f refactor(ci): restructure patch-build workflow script
- Extract inline bash script into structured functions
- Add proper error handling with set -euo pipefail
- Improve variable scoping with readonly and local declarations
- Add descriptive function names and comments
- Fix shell quoting and parameter expansion
- Consolidate build logic into reusable functions
- Add proper cleanup of temporary files
- Improve readability and maintainability of the CI script

The refactored script maintains the same functionality while being
more robust and easier to understand.

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2025-05-29 11:33:01 +02:00
rjshrjndrn
ab558555c4 tmp: remove
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2025-05-29 11:21:28 +02:00
9 changed files with 36 additions and 70 deletions

View file

@ -98,7 +98,7 @@ jobs:
local current_version new_version
current_version=$(yq eval '.AppVersion' "$chart_path")
new_version=$(echo "$current_version" | awk -F. '{$NF += 1; print $1"."$2"."$3}')
new_version=$(echo "$current_version" | awk -F. '{$NF += 2; print $1"."$2"."$3}')
echo "$new_version"
}
@ -119,6 +119,7 @@ jobs:
build_managed() {
local service=$1
local version=$2
local log_file="/tmp/managed_${service}.txt"
echo "Building managed service: $service"
clone_msaas
@ -131,9 +132,9 @@ jobs:
local build_cmd="IMAGE_TAG=$version DOCKER_RUNTIME=depot DOCKER_BUILD_ARGS=--push ARCH=arm64 DOCKER_REPO=$DOCKER_REPO_ARM PUSH_IMAGE=0 bash build.sh"
echo "Executing: $build_cmd"
if ! eval "$build_cmd" 2>&1; then
if ! eval "$build_cmd" >>"$log_file" 2>&1; then
echo "Build failed for $service"
cat "$log_file"
exit 1
fi
}
@ -214,7 +215,7 @@ jobs:
# Build FOSS and EE versions
build_service "$service" "$version" "$foss_build_args"
build_service "$service" "${version}-ee" "$ee_build_args"
build_service "$service" "$version" "$ee_build_args"
# Build managed version for specific services
if [[ "$service" != "chalice" && "$service" != "frontend" ]]; then
@ -237,16 +238,16 @@ jobs:
main "$SERVICES_INPUT"
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.ACTIONS_COMMMIT_TOKEN }}
source_branch: ${{ env.BRANCH_NAME }}
destination_branch: "main"
pr_title: "Updated patch build from main ${{ env.HEAD_COMMIT_ID }}"
pr_body: |
This PR updates the Helm chart version after building the patch from $HEAD_COMMIT_ID.
Once this PR is merged, tag update job will run automatically.
# - name: Create Pull Request
# uses: repo-sync/pull-request@v2
# with:
# github_token: ${{ secrets.ACTIONS_COMMMIT_TOKEN }}
# source_branch: ${{ env.BRANCH_NAME }}
# destination_branch: "main"
# pr_title: "Updated patch build from main ${{ env.HEAD_COMMIT_ID }}"
# pr_body: |
# This PR updates the Helm chart version after building the patch from $HEAD_COMMIT_ID.
# Once this PR is merged, tag update job will run automatically.
# - name: Debug Job
# if: ${{ failure() }}

View file

@ -50,8 +50,8 @@ class JIRAIntegration(base.BaseIntegration):
cur.execute(
cur.mogrify(
"""SELECT username, token, url
FROM public.jira_cloud
WHERE user_id = %(user_id)s;""",
FROM public.jira_cloud
WHERE user_id=%(user_id)s;""",
{"user_id": self._user_id})
)
data = helper.dict_to_camel_case(cur.fetchone())
@ -95,9 +95,10 @@ class JIRAIntegration(base.BaseIntegration):
def add(self, username, token, url, obfuscate=False):
with pg_client.PostgresClient() as cur:
cur.execute(
cur.mogrify(""" \
INSERT INTO public.jira_cloud(username, token, user_id, url)
VALUES (%(username)s, %(token)s, %(user_id)s, %(url)s) RETURNING username, token, url;""",
cur.mogrify("""\
INSERT INTO public.jira_cloud(username, token, user_id,url)
VALUES (%(username)s, %(token)s, %(user_id)s,%(url)s)
RETURNING username, token, url;""",
{"user_id": self._user_id, "username": username,
"token": token, "url": url})
)
@ -111,10 +112,9 @@ class JIRAIntegration(base.BaseIntegration):
def delete(self):
with pg_client.PostgresClient() as cur:
cur.execute(
cur.mogrify(""" \
DELETE
FROM public.jira_cloud
WHERE user_id = %(user_id)s;""",
cur.mogrify("""\
DELETE FROM public.jira_cloud
WHERE user_id=%(user_id)s;""",
{"user_id": self._user_id})
)
return {"state": "success"}
@ -125,7 +125,7 @@ class JIRAIntegration(base.BaseIntegration):
changes={
"username": data.username,
"token": data.token if len(data.token) > 0 and data.token.find("***") == -1 \
else self.integration["token"],
else self.integration.token,
"url": str(data.url)
},
obfuscate=True

View file

@ -23,7 +23,6 @@ function BottomButtons({
<Button
loading={loading}
type="primary"
htmlType="submit"
disabled={loading || !instance.validate()}
id="submit-button"
>

View file

@ -64,7 +64,6 @@ function DashboardView(props: Props) {
};
useEffect(() => {
dashboardStore.resetPeriod();
if (queryParams.has('modal')) {
onAddWidgets();
trimQuery();

View file

@ -117,6 +117,8 @@ const ListView: React.FC<Props> = ({
if (disableSelection) {
const path = withSiteId(`/metrics/${metric.metricId}`, siteId);
history.push(path);
} else {
toggleSelection?.(metric.metricId);
}
};

View file

@ -42,7 +42,7 @@ function DropdownAudioPlayer({
return {
url: data.url,
timestamp: data.timestamp,
start: Math.max(0, startTs),
start: startTs,
};
}),
[audioEvents.length, sessionStart],

View file

@ -1,13 +1,12 @@
import { makeAutoObservable, runInAction, reaction } from 'mobx';
import { dashboardService, metricService } from 'App/services';
import { toast } from 'react-toastify';
import Period, { LAST_24_HOURS } from 'Types/app/period';
import Period, { LAST_24_HOURS, LAST_7_DAYS } from 'Types/app/period';
import { getRE } from 'App/utils';
import Filter from './types/filter';
import Widget from './types/widget';
import Dashboard from './types/dashboard';
import { calculateGranularities } from '@/components/Dashboard/components/WidgetDateRange/RangeGranularity';
import { CUSTOM_RANGE } from '@/dateRange';
interface DashboardFilter {
query?: string;
@ -91,20 +90,16 @@ export default class DashboardStore {
() => this.period,
(period) => {
this.createDensity(period.getDuration());
},
);
}
)
}
resetDensity = () => {
this.createDensity(this.period.getDuration());
};
createDensity = (duration: number) => {
const densityOpts = calculateGranularities(duration);
const defaultOption = densityOpts[densityOpts.length - 2];
this.setDensity(defaultOption.key);
};
this.setDensity(defaultOption.key)
}
setDensity = (density: number) => {
this.selectedDensity = density;
@ -467,7 +462,7 @@ export default class DashboardStore {
this.isSaving = true;
try {
try {
await dashboardService.addWidget(dashboard, metricIds);
const response = await dashboardService.addWidget(dashboard, metricIds);
toast.success('Card added to dashboard.');
} catch {
toast.error('Card could not be added.');
@ -477,17 +472,6 @@ export default class DashboardStore {
}
}
resetPeriod = () => {
if (this.period) {
const range = this.period.rangeName;
if (range !== CUSTOM_RANGE) {
this.period = Period({ rangeName: this.period.rangeName });
} else {
this.period = Period({ rangeName: LAST_24_HOURS });
}
}
};
setPeriod(period: any) {
this.period = Period({
start: period.start,
@ -561,7 +545,7 @@ export default class DashboardStore {
const data = await metricService.getMetricChartData(
metric,
params,
isSaved,
isSaved
);
resolve(metric.setData(data, period, isComparison, density));
} catch (error) {

View file

@ -54,25 +54,6 @@ server {
add_header 'Access-Control-Allow-Headers' 'Content-Type,Authorization,Content-Encoding';
add_header 'Access-Control-Expose-Headers' 'Content-Length';
}
location /integrations/ {
rewrite ^/integrations/(.*) /$1 break;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $real_ip;
proxy_set_header X-Forwarded-Host $real_ip;
proxy_set_header X-Real-IP $real_ip;
proxy_set_header Host $host;
proxy_pass http://integrations-openreplay:8080;
proxy_read_timeout 300;
proxy_connect_timeout 120;
proxy_send_timeout 300;
# CORS Headers
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'POST,PATCH,OPTIONS,DELETE';
add_header 'Access-Control-Allow-Headers' 'Content-Type,Authorization,Content-Encoding,X-Openreplay-Batch';
add_header 'Access-Control-Expose-Headers' 'Content-Length';
}
location /api/ {
rewrite ^/api/(.*) /$1 break;

View file

@ -18,4 +18,4 @@ version: 0.1.10
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
AppVersion: "v1.22.42"
AppVersion: "v1.22.39"