Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Libraries/Core/ReactNativeVersion.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* @generated by scripts/set-rn-version.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @generated by scripts/set-rn-version.js
* @flow strict
*/

exports.version = {
major: 0,
major: 1000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Change looks fine to me. Let's just make sure that the nightly and the commitly jobs are effectively changing this to 0. I'd like to avoid to publish 1000.0.0-20220928-2025-527cc3426 on NPM just because the script it's appending the date/sha 👍

Copy link
Contributor Author

@kelset kelset Sep 29, 2022

Choose a reason for hiding this comment

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

we should be fine for nightlies, the flag sets the version to 0.0.0 here:

const rawVersion =

and then releaseversion gets modified here:

releaseVersion = `${version}-${dateIdentifier}-${shortCommit}`;

then according to this

// For stable, pre-release releases, we rely on CircleCI job `prepare_package_for_release` to handle this

we can see this

node ./scripts/prepare-package-for-release.js -v << parameters.version >> -l << parameters.latest >>

and finally here we have
https://github.com/facebook/react-native/blob/main/scripts/prepare-package-for-release.js#L57

so we should be good to go, both are using the same set-rn-version so they'll touch the same files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but that said, for commitlies it's not setting it to 0.0.0 - uh.

We might need to change this

nightlyBuild

to use isCommitly? 🤔
Why are commitlies not set to 0.0.0? can they be happening on stable branches?
cc @lunaleaps ?

Copy link
Contributor

@lunaleaps lunaleaps Sep 29, 2022

Choose a reason for hiding this comment

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

Hmm trying to page this all back in. Yes I believe commitlies can happen on stable branches -- I think the idea was that we could have PRs against the stable branch if people wanted to release a new patch -- and could use the commitly to verify but that may not actually be a workflow we need to support.

I think the 0.0.0 versioning is just that we could publish nightlies and it wouldn't affect npm version ordering but I think commitlies probably were grandfathered in to keep the 1000 version (I don't know why this was chosen)-- I don't think it was an intentional thing. I think we could probably update everything to 0.0.0

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, I'm stupid - I should have read the comment at the start of the file:

* * Version the commitly of the form `1000.0.0-<commitSha>`

looks like currently we do have commitlies in the 1000.0.0 format - @cortinico I don't know if we want to move away from the pre-established approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like currently we do have commitlies in the 1000.0.0 format - @cortinico I don't know if we want to move away from the pre-established approach.

Ideally yes. I would refrain from packaging anythign on 1000.x versioning scheme.
Commitlies are just nightlies from my point of view (with a different date/time and sha) + we don't npm publish them. Aside from this, versioning schema should be the same.

As @lunaleaps, commitlies are avaialble on every commit, also release branches. In an ideal world, release managers should test the commitly before triggering the publish job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok so just to make sure I'm understanding - I should change the logic here to tag/version commitlies to use 0.0.0, correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't necessarily need to happen here. Can be a separate PR like "re-align commitlies versioning schema to follow the same as nightlies" or so 👍

minor: 0,
patch: 0,
prerelease: null,
Expand Down
10 changes: 5 additions & 5 deletions React/Base/RCTVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^(void){
__rnVersion = @{
RCTVersionMajor: @(0),
RCTVersionMinor: @(0),
RCTVersionPatch: @(0),
RCTVersionPrerelease: [NSNull null],
};
RCTVersionMajor: @(1000),
RCTVersionMinor: @(0),
RCTVersionPatch: @(0),
RCTVersionPrerelease: [NSNull null],
};
});
return __rnVersion;
}
2 changes: 1 addition & 1 deletion ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-main
VERSION_NAME=1000.0.0
GROUP=com.facebook.react

POM_NAME=ReactNative
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 0,
"major", 1000,
"minor", 0,
"patch", 0,
"prerelease", null);
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/cxxreact/ReactNativeVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace facebook::react {

constexpr struct {
int32_t Major = 0;
int32_t Major = 1000;
int32_t Minor = 0;
int32_t Patch = 0;
std::string_view Prerelease = "";
Expand Down