Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
861
Issues
861
List
Boards
Labels
Service Desk
Milestones
Merge Requests
53
Merge Requests
53
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
007358b3
Commit
007358b3
authored
2 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): sentry for angular
parent
37ac7b64
No related merge requests found
Pipeline
#77759762
failed
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
7 deletions
+76
-7
.gitlab-ci.yml
.gitlab-ci.yml
+37
-0
angular.json
angular.json
+5
-1
base-locale.sh
build/base-locale.sh
+1
-1
app.module.ts
src/app/app.module.ts
+20
-1
session.ts
src/app/services/session.ts
+7
-1
environment.prod.ts
src/environments/environment.prod.ts
+2
-1
environment.ts
src/environments/environment.ts
+2
-1
index.php
src/index.php
+2
-1
No files found.
.gitlab-ci.yml
View file @
007358b3
...
...
@@ -81,6 +81,8 @@ e2e:chrome:
build:review:
stage
:
build
before_script
:
-
sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script
:
-
npm ci && npm install -g gulp-cli
-
npm run postinstall
...
...
@@ -97,6 +99,8 @@ build:review:
build:production:en:
stage
:
build
before_script
:
-
sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script
:
-
npm ci && npm install -g gulp-cli
-
npm run postinstall
...
...
@@ -113,6 +117,8 @@ build:production:en:
build:production:i18n:
stage
:
build
before_script
:
-
sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script
:
-
npm ci && npm install -g gulp-cli
-
npm run postinstall
...
...
@@ -141,6 +147,15 @@ prepare:review:
-
master
-
test/gitlab-ci
prepare:review:sentry:
<<
:
*sentry_prepare
except
:
refs
:
-
master
-
test/gitlab-ci
dependencies
:
-
build:review
prepare:production:
stage
:
prepare
image
:
minds/ci:latest
...
...
@@ -156,6 +171,16 @@ prepare:production:
-
build:production:en
-
build:production:i18n
prepare:production:sentry:
<<
:
*sentry_prepare
only
:
refs
:
-
master
-
test/gitlab-ci
dependencies
:
-
build:production:en
-
build:production:i18n
review:start:
stage
:
review
image
:
minds/helm-eks:latest
...
...
@@ -278,3 +303,15 @@ deploy:production:
url
:
https://www.minds.com
when
:
delayed
start_in
:
2 hours
# reduce? can always be deployed manually earlier too
.sentry_prepare
:
&sentry_prepare
stage
:
prepare
image
:
getsentry/sentry-cli
script
:
-
echo "Create a new release $CI_COMMIT_SHA"
-
sentry-cli releases new $CI_COMMIT_SHA
-
sentry-cli releases set-commits --auto $CI_COMMIT_SHA
-
sentry-cli releases files $CI_COMMIT_SHA upload-sourcemaps $CI_PROJECT_DIR/dist/en -x .js -x .map --validate --verbose --rewrite --strip-common-prefix
-
sentry-cli releases finalize $CI_COMMIT_SHA
-
echo "Finalized release for $CI_COMMIT_SHA"
This diff is collapsed.
Click to expand it.
angular.json
View file @
007358b3
...
...
@@ -36,7 +36,11 @@
"production"
:
{
"optimization"
:
true
,
"outputHashing"
:
"all"
,
"sourceMap"
:
false
,
"sourceMap"
:
{
"hidden"
:
true
,
"scripts"
:
true
,
"styles"
:
true
},
"extractCss"
:
true
,
"namedChunks"
:
false
,
"aot"
:
true
,
...
...
This diff is collapsed.
Click to expand it.
build/base-locale.sh
View file @
007358b3
#!/bin/sh
export
NODE_OPTIONS
=
"--max-old-space-size=3584"
ng build
--prod
--vendor-chunk
--output-path
=
"
$1
/en/"
--deploy-url
=
"
$2
/en/"
--build-optimizer
=
false
--source-map
=
false
ng build
--prod
--vendor-chunk
--output-path
=
"
$1
/en/"
--deploy-url
=
"
$2
/en/"
--build-optimizer
=
false
This diff is collapsed.
Click to expand it.
src/app/app.module.ts
View file @
007358b3
import
{
CUSTOM_ELEMENTS_SCHEMA
,
NgModule
}
from
'
@angular/core
'
;
import
{
CUSTOM_ELEMENTS_SCHEMA
,
NgModule
,
Injectable
,
ErrorHandler
}
from
'
@angular/core
'
;
import
{
BrowserModule
}
from
'
@angular/platform-browser
'
;
import
{
BrowserAnimationsModule
}
from
'
@angular/platform-browser/animations
'
;
import
{
FormsModule
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
RouterModule
}
from
'
@angular/router
'
;
import
{
CaptchaModule
}
from
'
./modules/captcha/captcha.module
'
;
import
{
environment
}
from
'
../environments/environment
'
;
import
{
Minds
}
from
'
./app.component
'
;
...
...
@@ -59,6 +60,23 @@ import { CanaryModule } from './modules/canary/canary.module';
import
{
HttpClientModule
}
from
"
@angular/common/http
"
;
import
{
AnalyticsModule
}
from
"
./modules/analytics/analytics.module
"
;
import
*
as
Sentry
from
"
@sentry/browser
"
;
Sentry
.
init
({
dsn
:
"
https://3f786f8407e042db9053434a3ab527a2@sentry.io/1538008
"
,
// TODO: do not hardcard
release
:
environment
.
version
,
environment
:
(
<
any
>
window
.
Minds
).
environment
||
'
development
'
,
});
@
Injectable
()
export
class
SentryErrorHandler
implements
ErrorHandler
{
constructor
()
{}
handleError
(
error
)
{
// const eventId = Sentry.captureException(error.originalError || error);
// Sentry.showReportDialog({ eventId });
}
}
@
NgModule
({
bootstrap
:
[
Minds
...
...
@@ -122,6 +140,7 @@ import { AnalyticsModule } from "./modules/analytics/analytics.module";
ChannelsModule
,
],
providers
:
[
{
provide
:
ErrorHandler
,
useClass
:
SentryErrorHandler
},
MindsAppRoutingProviders
,
MINDS_PROVIDERS
,
MINDS_PLUGIN_PROVIDERS
,
...
...
This diff is collapsed.
Click to expand it.
src/app/services/session.ts
View file @
007358b3
...
...
@@ -2,6 +2,7 @@
* Sessions
*/
import
{
EventEmitter
}
from
'
@angular/core
'
;
import
*
as
Sentry
from
"
@sentry/browser
"
;
export
class
Session
{
...
...
@@ -56,8 +57,13 @@ export class Session {
});
}
if
(
window
.
Minds
.
user
)
if
(
window
.
Minds
.
user
)
{
// Attach user_guid to debug logs
Sentry
.
setUser
({
id
:
window
.
Minds
.
user
.
guid
,
});
return
window
.
Minds
.
user
;
}
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
src/environments/environment.prod.ts
View file @
007358b3
export
const
environment
=
{
production
:
true
production
:
true
,
version
:
"
VERSION
"
,
};
This diff is collapsed.
Click to expand it.
src/environments/environment.ts
View file @
007358b3
...
...
@@ -4,5 +4,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export
const
environment
=
{
production
:
false
production
:
false
,
version
:
"
VERSION
"
,
};
This diff is collapsed.
Click to expand it.
src/index.php
View file @
007358b3
...
...
@@ -129,7 +129,8 @@
"blockchain"
=>
(
object
)
Minds\Core\Di\Di
::
_
()
->
get
(
'Blockchain\Manager'
)
->
getPublicSettings
(),
"sale"
=>
Minds\Core\Config
::
_
()
->
get
(
'blockchain'
)[
'sale'
],
"last_tos_update"
=>
Minds\Core\Config
::
_
()
->
get
(
'last_tos_update'
)
?:
time
(),
"tags"
=>
Minds\Core\Config
::
_
()
->
get
(
'tags'
)
?:
[]
"tags"
=>
Minds\Core\Config
::
_
()
->
get
(
'tags'
)
?:
[],
"environment"
=>
getenv
(
'MINDS_ENV'
)
??
'development'
,
];
if
(
Minds\Core\Session
::
isLoggedIn
()){
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment