Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CM-807: Upgrading build dependencies #115

Merged
merged 24 commits into from
Jun 29, 2023
Merged

Conversation

SuperIzya
Copy link
Contributor

@SuperIzya SuperIzya commented May 23, 2023

All npm dependencies upgraded to remove outdated/deprecated/vulnerable ones.

Author Todo List:

  • Add/adjust tests (if applicable)
  • Build in CI passes
  • Latest master revision is merged into the branch
  • Self-Review
  • Set Ready For Review status

@SuperIzya SuperIzya requested a review from a team as a code owner May 23, 2023 14:55
@SuperIzya SuperIzya self-assigned this May 23, 2023
package.json Outdated Show resolved Hide resolved
@SuperIzya SuperIzya mentioned this pull request May 25, 2023
5 tasks
@SuperIzya SuperIzya changed the title Upgrading build dependencies CM-807: Upgrading build dependencies May 30, 2023
rollup/dist.config.js Outdated Show resolved Hide resolved
@SuperIzya SuperIzya mentioned this pull request Jun 1, 2023
5 tasks
@3link 3link self-requested a review June 5, 2023 07:19
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the value of CODECOV_TOKEN needs to be set in circleci env vars, or does it read it from somewhere else?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get the CODECOV_TOKEN in circleci env variables here: https://app.codecov.io/gh/LiveIntent/live-connect/settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. But before, I have to make sure that the tests are generating proper data for codecov (it's a matter of running the tests)

rollup/test-resources.config.js Show resolved Hide resolved
src/standard-live-connect.ts Outdated Show resolved Hide resolved
src/utils/page.ts Outdated Show resolved Hide resolved
import { fileURLToPath } from 'url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const packageJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', '..', 'package.json'), { encoding: 'utf-8' }))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be an import too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Comment on lines +72 to +76
window = win

expect(getPage(fw)).to.be.eql('https://liveintent.com/about?key=value')
// eslint-disable-next-line no-global-assign
window = oldWindow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a try with resources that guarantees that the window is restored to its old state be used here? Something like this: https://github.com/LiveIntent/live-connect/pull/116/files#diff-b1c4e1833e06200917cbcbfcd57a775db133813709cf27170f2325bc45a4bcf9?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a test. If it fails, then the code is wrong. I actually want it to fail in most spectacular way. That's why I don't want to put try-finally in this particular case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes to window visible outside of that test -e.g. if the expectation is not fulfilled and the test fails? If yes, I would rather prefer to keep it local to that test.

Copy link
Contributor Author

@SuperIzya SuperIzya Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, if the expect fails and the code never gets to window = oldWindow, which will lead to other tests failing - I don't really mind. IMHO, the tests should work in optimistic scenario and fail in any other case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tests should be isolated so that it is easy to understand what is broken. A test having effect on other tests - even if it is only in case of failure - is usually not what you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it does not affect other tests.
Tested with failing expectation expect(getPage(fw)).to.be.eql('https://liveintent.com/about1?key=value') - only 1 failed test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is that if it is used by other tests, it should be restored to its original state before the test ends. Tests should have no effect on each other and should not run using each other's state. I do not want to discuss it for too long. I leave it up to you if you change it or not.

ilya added 2 commits June 6, 2023 15:27
# Conflicts:
#	.circleci/config.yml
#	package-lock.json
#	package.json
#	test/unit/events/error-pixel.spec.ts
#	test/unit/manager/decisions.spec.ts
tsconfig.json Show resolved Hide resolved
tsconfig-test.json Show resolved Hide resolved
src/standard-live-connect.ts Outdated Show resolved Hide resolved
@SuperIzya SuperIzya merged commit 2fae9cb into master Jun 29, 2023
@SuperIzya SuperIzya deleted the NOISSUE-upgrade-build branch June 29, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants