Skip to content

Commit 3a8e67c

Browse files
authored
Merge branch 'main' into test/no-hardcoded-versions
2 parents 6e034c5 + a1442fe commit 3a8e67c

File tree

8 files changed

+57
-3
lines changed

8 files changed

+57
-3
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish packages to NPM
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release-to-npm:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 18
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- run: npm ci
24+
25+
- run: npm run compile
26+
27+
- name: Publish to npm
28+
env:
29+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
30+
NPM_CONFIG_PROVENANCE: true
31+
run: npx lerna publish --concurrency 1 from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes

.github/workflows/unit-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
run: npm run test
4949
- name: Report Coverage
5050
uses: codecov/codecov-action@v4
51+
env:
52+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5153
with:
5254
verbose: true
5355
node-windows-tests:
@@ -102,6 +104,8 @@ jobs:
102104
run: npm run test:browser
103105
- name: Report Coverage
104106
uses: codecov/codecov-action@v4
107+
env:
108+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
105109
with:
106110
verbose: true
107111
webworker-tests:
@@ -128,6 +132,8 @@ jobs:
128132
run: npm run test:webworker
129133
- name: Report Coverage
130134
uses: codecov/codecov-action@v4
135+
env:
136+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
131137
with:
132138
verbose: true
133139
api-eol-node-test:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
110110
* fix(resources): prevent circular import (resource -> detector -> resource -> ...) [#4653](https://github.com/open-telemetry/opentelemetry-js/pull/4653) @pichlermarc
111111
* fixes a circular import warning which would appear in rollup when bundling `@opentelemetry/resources`
112112
* fix(exporter-metrics-otlp-grpc): add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc [#4678](https://github.com/open-telemetry/opentelemetry-js/pull/4678) @AkselAllas
113+
* fix(resources) wait for async attributes for detecting resources [#4687](https://github.com/open-telemetry/opentelemetry-js/pull/4687) @ziolekjj
113114

114115
## 1.24.0
115116

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,16 @@ To run the unit tests continuously in watch mode while developing, use:
223223
npm run tdd
224224
```
225225

226+
Packages that are expected to run in the browser have browser specific tests:
227+
228+
```sh
229+
# Run browser-specific test
230+
npm run test:browser
231+
232+
# Run web worker test
233+
npm run test:webworker
234+
```
235+
226236
### Linting
227237

228238
This project uses `eslint` to lint source code. Just like tests and compilation, linting can be done for all packages or only a single package.

experimental/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ All notable changes to experimental packages in this project will be documented
4747
* `configureExporterTimeout`
4848
* `invalidTimeout`
4949
* fix(sdk-node): use warn instead of error on unknown OTEL_NODE_RESOURCE_DETECTORS values [#5034](https://github.com/open-telemetry/opentelemetry-js/pull/5034)
50+
* fix(exporter-logs-otlp-proto): Use correct config type in Node constructor
5051

5152
### :books: (Refine Doc)
5253

experimental/packages/exporter-logs-otlp-proto/src/platform/node/OTLPLogExporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import {
18-
OTLPExporterConfigBase,
1918
OTLPExporterNodeBase,
19+
OTLPExporterNodeConfigBase,
2020
} from '@opentelemetry/otlp-exporter-base';
2121
import {
2222
IExportLogsServiceResponse,
@@ -37,7 +37,7 @@ export class OTLPLogExporter
3737
extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>
3838
implements LogRecordExporter
3939
{
40-
constructor(config: OTLPExporterConfigBase = {}) {
40+
constructor(config: OTLPExporterNodeConfigBase = {}) {
4141
super(
4242
config,
4343
ProtobufLogsSerializer,

packages/opentelemetry-resources/src/detect-resources.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const detectResourcesSync = (
7070
if (isPromiseLike<Resource>(resourceOrPromise)) {
7171
const createPromise = async () => {
7272
const resolvedResource = await resourceOrPromise;
73+
await resolvedResource.waitForAsyncAttributes?.();
7374
return resolvedResource.attributes;
7475
};
7576
resource = new Resource({}, createPromise());

packages/opentelemetry-resources/test/detect-resources.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ describe('detectResourcesSync', () => {
2828
it('handles resource detectors which return Promise<Resource>', async () => {
2929
const detector: Detector = {
3030
async detect() {
31-
return new Resource({ sync: 'fromsync' });
31+
return new Resource(
32+
{ sync: 'fromsync' },
33+
Promise.resolve().then(() => ({ async: 'fromasync' }))
34+
);
3235
},
3336
};
3437
const resource = detectResourcesSync({
@@ -38,6 +41,7 @@ describe('detectResourcesSync', () => {
3841
await resource.waitForAsyncAttributes?.();
3942
assert.deepStrictEqual(resource.attributes, {
4043
sync: 'fromsync',
44+
async: 'fromasync',
4145
});
4246
});
4347

0 commit comments

Comments
 (0)