Skip to content

Commit

Permalink
CI fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Nov 18, 2022
1 parent 731bccb commit 901df9f
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/proto-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:

- uses: bufbuild/buf-setup-action@3e33fea8596569a62fcaa33eb3880b6ac7098941 # tag=v1.9.0

- name: version
run: buf --version

- name: Format
run: buf format --diff --exit-code

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/proto-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:

- uses: bufbuild/buf-setup-action@3e33fea8596569a62fcaa33eb3880b6ac7098941 # tag=v1.9.0

- name: version
run: buf --version

- name: Format
run: buf format --diff --exit-code

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ dev/up: deploy/manifests
dev/down:
source ./scripts/local-dev.sh && down

tmp/help.txt: go/bin
tmp/help.txt: build
mkdir -p tmp
bin/parca --help > $@

Expand Down
4 changes: 2 additions & 2 deletions proto/parca/debuginfo/v1alpha1/debuginfo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ message UploadInfo {
// hash is the hash of the source file that debug information extracted from
string hash = 2;

// TODO(kakkoyun): Add SourceHash and use Hash as debuginfo file hash.
// TODO(kakkoyun): Add SourceType enum.
// TODO(kakkoyun): Add SourceHash and use Hash as debuginfo file hash.
// TODO(kakkoyun): Add SourceType enum.
}

// UploadResponse returns the build_id and the size of the uploaded debug info
Expand Down
4 changes: 1 addition & 3 deletions proto/parca/profilestore/v1alpha1/profilestore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ message RawSample {
service AgentsService {
// Agents return the agents that pushed data to the server
rpc Agents(AgentsRequest) returns (AgentsResponse) {
option (google.api.http) = {
get: "/agents"
};
option (google.api.http) = {get: "/agents"};
}
}

Expand Down
24 changes: 6 additions & 18 deletions proto/parca/query/v1alpha1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,32 @@ import "parca/profilestore/v1alpha1/profilestore.proto";
service QueryService {
// QueryRange performs a profile query over a time range
rpc QueryRange(QueryRangeRequest) returns (QueryRangeResponse) {
option (google.api.http) = {
get: "/profiles/query_range"
};
option (google.api.http) = {get: "/profiles/query_range"};
}

// Query performs a profile query
rpc Query(QueryRequest) returns (QueryResponse) {
option (google.api.http) = {
get: "/profiles/query"
};
option (google.api.http) = {get: "/profiles/query"};
}

// Series is unimplemented
rpc Series(SeriesRequest) returns (SeriesResponse) {
option (google.api.http) = {
get: "/profiles/series"
};
option (google.api.http) = {get: "/profiles/series"};
}

// ProfileTypes returns the list of available profile types.
rpc ProfileTypes(ProfileTypesRequest) returns (ProfileTypesResponse) {
option (google.api.http) = {
get: "/profiles/types"
};
option (google.api.http) = {get: "/profiles/types"};
}

// Labels returns the set of label names against a given matching string and time frame
rpc Labels(LabelsRequest) returns (LabelsResponse) {
option (google.api.http) = {
get: "/profiles/labels"
};
option (google.api.http) = {get: "/profiles/labels"};
}

// Values returns the set of values that match a given label and time frame
rpc Values(ValuesRequest) returns (ValuesResponse) {
option (google.api.http) = {
get: "/profiles/labels/{label_name}/values"
};
option (google.api.http) = {get: "/profiles/labels/{label_name}/values"};
}

// ShareProfile uploads the given profile to pprof.me and returns a link to the profile.
Expand Down
4 changes: 1 addition & 3 deletions proto/parca/scrape/v1alpha1/scrape.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import "parca/profilestore/v1alpha1/profilestore.proto";
service ScrapeService {
// Targets returns the set of scrape targets that are configured
rpc Targets(TargetsRequest) returns (TargetsResponse) {
option (google.api.http) = {
get: "/targets"
};
option (google.api.http) = {get: "/targets"};
}
}

Expand Down
23 changes: 11 additions & 12 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a [Create React App](https://create-react-app.dev/) project that utilize

The React app requires an environment variable for the API endpoint so as to talk to the Parca backend. Create a file named `.env.local` in `packages/app/web/` to add the environment variable for the API endpoint.

```
```shell
REACT_APP_PUBLIC_API_ENDPOINT=http://localhost:7070
```

Expand Down Expand Up @@ -46,8 +46,7 @@ make ui/build # yarn install && yarn build

We embed the artifacts (the production build and its static assets) into the final binary distribution.
See https://pkg.go.dev/embed for further details.

Run following to build the `parca` binary with embedded assets.
Run the following to build the `parca` binary with embedded assets.

```shell
make build
Expand All @@ -63,7 +62,7 @@ You can set up a cluster and all else you need by simply running:
make dev/up
```

For a simple local development setup we use [Tilt](https://tilt.dev).
For a simple local development setup, we use [Tilt](https://tilt.dev).

```shell
tilt up
Expand All @@ -73,33 +72,33 @@ tilt up

We have a feature flag system that allows you to enable or disable features for a user browser. It's a naive implementation based on browser local storage.

#### Usage:
### Usage

```
```js
import useUIFeatureFlag from '@parca/functions/useUIFeatureFlag';

const Header = () => {
const isGreetingEnabled = useUIFeatureFlag('greeting');
return (
<div>
<img src="/logo.png" alt="Logo"/>
<img src="/logo.png" alt="Logo" />
{isGreetingEnabled ? <h1>Hello!!!</h1> : null}
</div>
);
}
};
```

For easy modification of the flag states, we added a two utility query params that can be used to control the feature flag state: `enable-ui-flag` and `disable-ui-flag`.
For easy modification of the flag states, we added two utility query params that can be used to control the feature flag state: `enable-ui-flag` and `disable-ui-flag`.

For example, if you want to enable the greeting feature for a browser, you can load the following URL:

```
```text
http://localhost:3000/?enable-ui-flag=greeting
```

Like wise, if you would like to disable the greeting feature for a browser, you can load the following URL:
Likewise, if you would like to disable the greeting feature for a browser, you can load the following URL:

```
```text
http://localhost:3000/?disable-ui-flag=greeting
```

Expand Down
38 changes: 29 additions & 9 deletions ui/packages/shared/client/src/google/protobuf/descriptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ export interface FieldDescriptorProto {
* For booleans, "true" or "false".
* For strings, contains the default text contents (not escaped in any way).
* For bytes, contains the C escaped value. All bytes >= 128 are escaped.
* TODO(kenton): Base-64 encode?
*
* @generated from protobuf field: optional string default_value = 7;
*/
Expand Down Expand Up @@ -979,9 +978,23 @@ export interface FieldOptions {
* check its required fields, regardless of whether or not the message has
* been parsed.
*
* As of 2021, lazy does no correctness checks on the byte stream during
* parsing. This may lead to crashes if and when an invalid byte stream is
* finally parsed upon access.
*
* TODO(b/211906113): Enable validation on lazy fields.
*
* @generated from protobuf field: optional bool lazy = 5;
*/
lazy?: boolean;
/**
* unverified_lazy does no correctness checks on the byte stream. This should
* only be used where lazy with verification is prohibitive for performance
* reasons.
*
* @generated from protobuf field: optional bool unverified_lazy = 15;
*/
unverifiedLazy?: boolean;
/**
* Is this field deprecated?
* Depending on the target platform, this can emit Deprecated annotations
Expand Down Expand Up @@ -1230,8 +1243,8 @@ export interface UninterpretedOption {
* The name of the uninterpreted option. Each string represents a segment in
* a dot-separated name. is_extension is true iff a segment represents an
* extension (denoted with parentheses in options specs in .proto files).
* E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
* "foo.(bar.baz).qux".
* E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
* "foo.(bar.baz).moo".
*
* @generated from protobuf message google.protobuf.UninterpretedOption.NamePart
*/
Expand Down Expand Up @@ -1313,8 +1326,8 @@ export interface SourceCodeInfo_Location {
* location.
*
* Each element is a field number or an index. They form a path from
* the root FileDescriptorProto to the place where the definition. For
* example, this path:
* the root FileDescriptorProto to the place where the definition occurs.
* For example, this path:
* [ 4, 3, 2, 7, 1 ]
* refers to:
* file.message_type(3) // 4, 3
Expand Down Expand Up @@ -1374,13 +1387,13 @@ export interface SourceCodeInfo_Location {
* // Comment attached to baz.
* // Another line attached to baz.
*
* // Comment attached to qux.
* // Comment attached to moo.
* //
* // Another line attached to qux.
* optional double qux = 4;
* // Another line attached to moo.
* optional double moo = 4;
*
* // Detached comment for corge. This is not leading or trailing comments
* // to qux or corge because there are blank lines separating it from
* // to moo or corge because there are blank lines separating it from
* // both.
*
* // Detached comment for corge paragraph 2.
Expand Down Expand Up @@ -2681,6 +2694,7 @@ class FieldOptions$Type extends MessageType<FieldOptions> {
{ no: 2, name: "packed", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 6, name: "jstype", kind: "enum", opt: true, T: () => ["google.protobuf.FieldOptions.JSType", FieldOptions_JSType] },
{ no: 5, name: "lazy", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 15, name: "unverified_lazy", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 3, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 10, name: "weak", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption }
Expand Down Expand Up @@ -2710,6 +2724,9 @@ class FieldOptions$Type extends MessageType<FieldOptions> {
case /* optional bool lazy */ 5:
message.lazy = reader.bool();
break;
case /* optional bool unverified_lazy */ 15:
message.unverifiedLazy = reader.bool();
break;
case /* optional bool deprecated */ 3:
message.deprecated = reader.bool();
break;
Expand Down Expand Up @@ -2743,6 +2760,9 @@ class FieldOptions$Type extends MessageType<FieldOptions> {
/* optional bool lazy = 5; */
if (message.lazy !== undefined)
writer.tag(5, WireType.Varint).bool(message.lazy);
/* optional bool unverified_lazy = 15; */
if (message.unverifiedLazy !== undefined)
writer.tag(15, WireType.Varint).bool(message.unverifiedLazy);
/* optional bool deprecated = 3; */
if (message.deprecated !== undefined)
writer.tag(3, WireType.Varint).bool(message.deprecated);
Expand Down
1 change: 0 additions & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import "embed"

//nolint:typecheck
//go:embed packages/app/web/build

var FS embed.FS

// NOTICE: Static HTML export of a Next.js app contains several files prefixed with _,
Expand Down

0 comments on commit 901df9f

Please sign in to comment.