Skip to content

Commit

Permalink
Merge branch 'master' into wmak/feat/timeorigin-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
wmak committed Apr 6, 2021
2 parents 1f70986 + 03ed509 commit 89c6efe
Show file tree
Hide file tree
Showing 289 changed files with 9,970 additions and 6,626 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/backend-typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
- name: Setup backend typing
if: steps.changes.outputs.backend == 'true'
env:
SENTRY_LIGHT_BUILD: 1
run: |
python setup.py install_egg_info
pip install wheel # GitHub Actions does not have `wheel` installed by default
Expand Down
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/*eslint import/no-nodejs-modules:0 */
module.exports = {
stories: ['../docs-ui/components/*.stories.*'],
core: {
builder: 'webpack5',
},
addons: [
{
name: '@storybook/addon-essentials',
Expand Down
11 changes: 4 additions & 7 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ module.exports = ({config} = {config: emptyConfig}) => {
test: /\.(mjs|[tj]sx?)$/,
include: [path.join(__dirname), staticPath, path.join(__dirname, '../docs-ui')],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader'],
Expand Down Expand Up @@ -86,9 +82,7 @@ module.exports = ({config} = {config: emptyConfig}) => {
jQuery: 'jquery',
}),
new webpack.DefinePlugin({
'process.env': {
FIXED_DYNAMIC_CONTENT: true,
},
'process.env.FIXED_DYNAMIC_CONTENT': true,
}),
],

Expand All @@ -102,6 +96,9 @@ module.exports = ({config} = {config: emptyConfig}) => {
...appConfig.resolve.alias,
app: staticPath,
},
fallback: {
...appConfig.resolve.fallback,
},
},
};

Expand Down
12 changes: 9 additions & 3 deletions build-utils/optional-locale-chunk-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@
* This plugin removes the locale chunks from the app entrypoint's immediate
* chunk dependants list, ensuring that the compiled entrypoint will execute
* *without* all locale chunks loaded.
*
* Note that the locale actually gets initially loaded in the server template and
* the frontend code (in `app/translations`) may be redundant.
*/
const PLUGIN_NAME = 'OptionalLocaleChunkPlugin';

const clearLocaleChunks = chunks =>
chunks
const clearLocaleChunks = chunks => {
Array.from(chunks)
.filter(chunk => chunk.name !== 'app')
.forEach(chunk => {
const mainGroup = Array.from(chunk.groupsIterable)[0];
// With the upgrade from webpack4 -> 5, we have a lot more chunks without a name
// Not entirely sure why, but we want to keep these chunks without names
mainGroup.chunks = mainGroup.chunks.filter(
c => c.name && !c.name.startsWith('locale')
c => !c.name || !c.name.startsWith('locale')
);
});
};

class OptionalLocaleChunkPlugin {
apply(compiler) {
Expand Down
3 changes: 1 addition & 2 deletions config/webpack.chartcuterie.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const config = {

target: 'node',
entry: {
config: 'app/chartcuterieConfig',
config: 'app/chartcuterie/config',
},

module: {
Expand All @@ -40,7 +40,6 @@ const config = {
libraryTarget: 'commonjs2',
},

devtool: 'none',
optimization: {minimize: false},
};

Expand Down
132 changes: 130 additions & 2 deletions docs-ui/components/charts-chartcuterie.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import styled from '@emotion/styled';
import echarts from 'echarts/lib/echarts';
import ReactEchartsCore from 'echarts-for-react/lib/core';

import config, {ChartType} from 'app/chartcuterieConfig';
import config from 'app/chartcuterie/config';
import {ChartType} from 'app/chartcuterie/types';
import {getDimensionValue} from 'app/components/charts/utils';
import space from 'app/styles/space';

Expand Down Expand Up @@ -55,7 +56,134 @@ export const _SlackDiscoverTotalPeriod = () => {
width: getDimensionValue(width),
}}
opts={{height, width, renderer: 'canvas'}}
option={getOption(data)}
option={getOption({seriesName: 'count()', stats: {data}})}
/>
</Container>
);
};

export const _SlackDiscoverTotalDaily = () => {
const data = [
[1615852800, [{count: 2426486}]],
[1615939200, [{count: 18837228}]],
[1616025600, [{count: 14662530}]],
[1616112000, [{count: 15102981}]],
[1616198400, [{count: 7759228}]],
[1616284800, [{count: 7216556}]],
[1616371200, [{count: 16976035}]],
[1616457600, [{count: 17240832}]],
[1616544000, [{count: 16814701}]],
[1616630400, [{count: 17480989}]],
[1616716800, [{count: 15387478}]],
[1616803200, [{count: 8467454}]],
[1616889600, [{count: 6382678}]],
[1616976000, [{count: 16842851}]],
[1617062400, [{count: 12959057}]],
];

const {height, width, getOption} = renderConfig.get(
ChartType.SLACK_DISCOVER_TOTAL_DAILY
);

return (
<Container>
<ReactEchartsCore
echarts={echarts}
style={{
height: getDimensionValue(height),
width: getDimensionValue(width),
}}
opts={{height, width, renderer: 'canvas'}}
option={getOption({seriesName: 'count()', stats: {data}})}
/>
</Container>
);
};

export const _SlackDiscoverTop5 = () => {
const stats = {
'ludic-science,1st event': {
data: [
[1615877940, [{count: 0}]],
[1615878000, [{count: 0}]],
[1615878060, [{count: 0}]],
[1615878120, [{count: 0}]],
[1615878180, [{count: 1}]],
[1615878240, [{count: 1}]],
[1615878300, [{count: 1}]],
[1615878360, [{count: 1}]],
[1615878420, [{count: 1}]],
[1615878480, [{count: 1}]],
[1615878540, [{count: 1}]],
[1615878600, [{count: 1}]],
[1615878660, [{count: 1}]],
[1615878720, [{count: 1}]],
[1615878780, [{count: 1}]],
[1615878840, [{count: 1}]],
[1615878900, [{count: 1}]],
[1615878960, [{count: 1}]],
[1615879020, [{count: 1}]],
[1615879080, [{count: 1}]],
[1615879140, [{count: 1}]],
[1615879200, [{count: 1}]],
[1615879260, [{count: 1}]],
[1615879320, [{count: 1}]],
[1615879380, [{count: 0}]],
[1615879440, [{count: 0}]],
[1615879500, [{count: 0}]],
[1615879560, [{count: 0}]],
[1615879620, [{count: 0}]],
],
order: 0,
},
'ludic-science,2nd event': {
data: [
[1615877940, [{count: 0}]],
[1615878000, [{count: 0}]],
[1615878060, [{count: 0}]],
[1615878120, [{count: 0}]],
[1615878180, [{count: 1}]],
[1615878240, [{count: 1}]],
[1615878300, [{count: 1}]],
[1615878360, [{count: 1}]],
[1615878420, [{count: 1}]],
[1615878480, [{count: 1}]],
[1615878540, [{count: 1}]],
[1615878600, [{count: 1}]],
[1615878660, [{count: 1}]],
[1615878720, [{count: 1}]],
[1615878780, [{count: 1}]],
[1615878840, [{count: 1}]],
[1615878900, [{count: 1}]],
[1615878960, [{count: 1}]],
[1615879020, [{count: 1}]],
[1615879080, [{count: 1}]],
[1615879140, [{count: 1}]],
[1615879200, [{count: 1}]],
[1615879260, [{count: 1}]],
[1615879320, [{count: 1}]],
[1615879380, [{count: 0}]],
[1615879440, [{count: 0}]],
[1615879500, [{count: 0}]],
[1615879560, [{count: 0}]],
[1615879620, [{count: 0}]],
],
order: 1,
},
};

const {height, width, getOption} = renderConfig.get(ChartType.SLACK_DISCOVER_TOP5);

return (
<Container>
<ReactEchartsCore
echarts={echarts}
style={{
height: getDimensionValue(height),
width: getDimensionValue(width),
}}
opts={{height, width, renderer: 'canvas'}}
option={getOption({stats})}
/>
</Container>
);
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ files = src/sentry/notifications/*.py,
src/sentry/snuba/query_subscription_consumer.py,
src/sentry/utils/codecs.py,
src/sentry/utils/kvstore,
src/sentry/utils/snql.py,
src/sentry/snuba/outcomes.py

; Enable all options used with --strict
Expand All @@ -21,6 +22,9 @@ warn_unused_ignores=True
warn_return_any=True
no_implicit_reexport=True

; Set this to skip until more of the codebase is typed
follow_imports = skip


[mypy-confluent_kafka.*]
ignore_missing_imports = True
Expand Down
Loading

0 comments on commit 89c6efe

Please sign in to comment.