Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Update packages #156

Merged
merged 98 commits into from Feb 28, 2017
Merged

Update packages #156

merged 98 commits into from Feb 28, 2017

Conversation

dennari
Copy link
Contributor

@dennari dennari commented Jan 25, 2017

This is quite a significant maintenance PR and should be subjected to major testing at least in staging.

NOTE: since eventsource was updated, you should clean redis with

rm -rf gitlab-data/redis

before testing.

@dennari dennari mentioned this pull request Jan 25, 2017
"inversify": "^2.0.1",
"joi": "^10.0.5",
"hapi": "^16.1.0",
"hapi-auth-jwt2": "^7.2.4",
Copy link
Member

Choose a reason for hiding this comment

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

Should probably be added in the Auth-related PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, these two slipped in by accident

Copy link
Member

Choose a reason for hiding this comment

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

@dennari These two slipped back in

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, I now remembered that this PR does, in fact, now have much more than just updated packages in it.

package.json Outdated
"jsonapi-serializer": "^3.4.2",
"jwks-rsa": "^1.1.1",
Copy link
Member

Choose a reason for hiding this comment

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

Is this also related to authentication?

@@ -391,4 +393,8 @@ export class JsonApiModule {
};
}

public toApiNotificationConfiguration(configuration: NotificationConfiguration): ApiNotificationConfiguration {
return configuration as ApiNotificationConfiguration;
Copy link
Member

Choose a reason for hiding this comment

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

This function seems a bit suspect. The function name makes it seem that some sort of conversion is being done when, in reality, it's just hard-casting it to another type.

Copy link
Contributor Author

@dennari dennari Jan 26, 2017

Choose a reason for hiding this comment

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

It is a conversion. The fact that the interfaces are actually identical and the conversion can be done like this is an implementation detail that shouldn't concern the consumers of this method.

If they become unidentical at some point the conversion logic is placed here.

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 you're right in that the argument should be cloned at least

@vsaarinen
Copy link
Member

As mentioned, it might be a good idea to read over the CHANGELOG for every package that had a major or minor revision. Even though, technically, you should only be afraid of breaking changes for major version updates, I've noticed this not to always be the case.

@@ -394,7 +394,7 @@ export class JsonApiModule {
}

public toApiNotificationConfiguration(configuration: NotificationConfiguration): ApiNotificationConfiguration {
return configuration as ApiNotificationConfiguration;
return { ...configuration } as ApiNotificationConfiguration;
Copy link
Member

Choose a reason for hiding this comment

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

If they have the same structure, shouldn't this work without the cast? Doesn't the as ApiNotificationConfiguration typecast hide errors in case the shapes change in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's actually an excellent point. It should and it hides. This is something that's been unclear to me, i.e. these explicit vs. implicit casts in TypeScript. If I'm not mistaken, casting with as doesn't work in every situation and I don't really know what are the situations when it doesn't work. Here's some discussion about these matters: microsoft/TypeScript#7481.

@vsaarinen
Copy link
Member

Can this be deployed onto staging for testing purposes before it's merged into master?

@dennari
Copy link
Contributor Author

dennari commented Jan 26, 2017

Yes, that's probably a good idea

@dennari
Copy link
Contributor Author

dennari commented Jan 31, 2017

Ok, checked the changes introduced in minor versions. LGTM.

@vsaarinen vsaarinen merged commit 26f3d57 into master Feb 28, 2017
@juhoojala juhoojala deleted the update-packages branch April 24, 2017 08:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants