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

[TIMOB-25032] iOS: Resolve asset-catalog hashes back to real names, fail build when detecting duplicates #10239

Closed
wants to merge 5 commits into from

Conversation

Sajoha
Copy link

@Sajoha Sajoha commented Aug 8, 2018

JIRA: https://jira.appcelerator.org/browse/TIMOB-25032

Removed hashing from file names, first in the build step, so assets are stored under their real names, with checks in place to make sure duplicates are not used. And also in the module code to ensure de-hashing isn't attempted

@build
Copy link
Contributor

build commented Aug 8, 2018

Fails
🚫

Tests have failed, see below for more information.

Messages
📖

💾 Here's the generated SDK zipfile.

Tests:

Classname Name Time Error
android.Error JSON.stringify(NestedError) 0 AssertionError: expected undefined to equal 'Top error message'
android.Error JSON.stringify(Error) 0.002 AssertionError: expected undefined to equal 'My error message'
android.Timers #setInterval accepts callback and no specified interval 0.001 Error: the string "setInterval: Invalid number of arguments. Expected 2 but got 1" was thrown, throw an Error :)
android.Timers #setTimeout accepts callback and no specified interval 0.001 Error: the string "setTimeout: Invalid number of arguments. Expected 2 but got 1" was thrown, throw an Error :)
android.Titanium.Blob #imageAsThumbnail() with PNG generates an image with desired size plus a default 1px border around that 0.011 AssertionError: expected 50 to equal 52
android.Titanium.Blob .size returns pixel count for image (PNG) 0.001 AssertionError: expected undefined to be a number
android.Titanium.Blob .size returns byte count of non-image (JS file) 0 AssertionError: expected undefined to be a number
android.Titanium.Blob #append() appends two files together 0.002 Error: Not yet implemented. TYPE_FILE
android.Titanium.Locale #getString() returns key if supplied default is not a String and key/value pair not found 0 AssertionError: expected null to equal 'this_should_not_be_found'
android.Titanium.Locale #getString() returns key if not found and no default specified 0.001 AssertionError: expected null to equal 'this_should_not_be_found'
android.Titanium.Network.Socket.TCP #connect(), #write(), #pump() async 60.061 Error: timeout of 60000ms exceeded
android.Titanium.Network.Socket.TCP #connect() and #write() async 60.02 Error: timeout of 60000ms exceeded
android.Titanium.UI.ImageView Load Local Image 10.042 Error: timeout of 10000ms exceeded
android.Titanium.UI.ImageView .image (root-relative-path) 10.059 Error: timeout of 10000ms exceeded
android.Titanium.UI.ListView .fastScroll 0.002 AssertionError: expected undefined to equal false
android.Titanium.UI.Picker Selected index persistance 10.044 Error: timeout of 10000ms exceeded
android.Titanium.UI.TabGroup Tab group blur event 2.005 Error: timeout of 2000ms exceeded
android.Titanium.UI.WebView #evalJS(string, function) - async variant 30.002 Error: timeout of 30000ms exceeded
android.Titanium.UI.Window .safeAreaPadding with extendSafeArea true 0.12 AssertionError: expected undefined to be an object
android.Titanium.UI.Window .safeAreaPadding with extendSafeArea false 0.158 AssertionError: expected undefined to be an object
ios.Error JSON.stringify(NestedError) 0 file:///Users/build/Library/Developer/CoreSimu
ios.Error JSON.stringify(Error) 0.001 file:///Users/build/Library/Developer/CoreSim
ios.Timers #setInterval accepts callback, interval, and additional arguments 0.001 fail@file:///Users/build/Library/Developer/CoreSimulator/Devices/8EAF
ios.Timers #setInterval accepts callback and no specified interval 0.001 fail@file:///Users/build/Library/Developer/CoreSimulator/Devices/8EAF
ios.Timers #setTimeout accepts callback, interval, and additional arguments 0 fail@file:///Users/build/Library/Developer/CoreSimulator/Devices/8EAF
ios.Timers #setTimeout accepts callback and no specified interval 0.001 fail@file:///Users/build/Library/Developer/CoreSimulator/Devices/8EAF
ios.Titanium.Blob #imageWithTransparentBorder() with PNG adds border around original image 0.001 file:///Users/build/Li
ios.Titanium.Blob #imageWithRoundedCorner() with PNG generates rounded corner image with an additional default border of 1 0.004 file:///Users/build/Li
ios.Titanium.Blob #append() appends two files together 0.002 file:///Users/build/Library/Developer/CoreSimulator/Devices/8EAF3FE0-C5BC-4550-ADB3-6CE746ABE6C6/data
ios.Titanium.Blob #append() is a Function 0.001 file:///Users/build/Library/Develo
ios.Titanium.Locale #getString() returns key if supplied default is not a String and key/value pair not found 0.139 [native code]
file:///Users/build/Library/Developer/CoreSimulator/D
ios.Titanium.Media.VideoPlayer playableDuration in milliseconds 0.412 file:///Users/build/Library/Developer/CoreS
ios.Titanium.Network encodeURIComponent() 0.006 file:///Users/build/Library/Developer/CoreSimulator/Devices/8EAF3FE0-C5BC-4550-ADB3-6CE746ABE6C6/data/Containers/B
ios.Titanium.Network.HTTPClient send on response 60.013 file:///Users/build/Librar
ios.Titanium.Network.Socket.TCP #connect(), #write(), #pump() async 60.011 file:///Users/build/Librar
ios.Titanium.Network.Socket.TCP #connect() and #write() async 60.011 file:///Users/build/Librar
ios.Titanium.UI.WebView should handle file URLs with spaces in path - TIMOB-18765 30.007 file:///Users/build/Librar
ios.Titanium.UI.WebView #evalJS(string, function) - async variant 30.009 file:///Users/build/Librar
ios.Titanium.UI.Window .safeAreaPadding for window inside navigation window with extendSafeArea true 0.027 [native code]
file:///Users/build/Library/Developer/CoreS

Generated by 🚫 dangerJS

Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

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

Left a few changes. Also requesting Chris' review for the CLI part of this.

RELEASE_TO_NIL(sha)
}
}
NSString *fileName = [imageArg lastPathComponent];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can reuse the existing imageArg property:

imageArg = [imageArg lastPathComponent];

and align it to line 198 to be right after the other string manipulations. Same for other occurences of this code in the core.

const checked = new Set();
const duplicates = new Set();

Object.keys(imageAssets).forEach(function (assetName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe some ES6 here?

Object.keys(imageAssets).forEach(assetName => {

});

if (duplicates.size > 0) {
duplicates.forEach(function (asset) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

=>


if (duplicates.size > 0) {
duplicates.forEach(function (asset) {
this.logger.error(__('Image asset name "%s" used multiple time, duplicate names are not permitted', asset));
Copy link
Collaborator

Choose a reason for hiding this comment

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

this.logger.error(__('Image asset name "%s" used multiple time, asset names should be unique in Titanium SDK 8.0.0+', asset));

@hansemannn hansemannn added this to the 8.0.0 milestone Aug 8, 2018
Rebased with master to resolve existing merge conflicts

BREAKING CHANGE: Will throw an error on build if there are duplicated image names in the project
Changed the warning message from notifying of 8.0.0 to 9.0.0
@build
Copy link
Contributor

build commented May 21, 2019

Fails
🚫

😥 npm test failed. See below for details.

Warnings
⚠️

🔍 Can't find junit reports at ./junit.*.xml, skipping generating JUnit Report.

⚠️

Commit 8f8a498a64c8a3a35616d70344cd82f166089aed has a message "[TIMOB-25032] iOS: Resolve asset-catalog hashes back to real names, fail build when detecting duplicates" giving 3 errors:

  • header must not be longer than 72 characters, current length is 104
  • subject may not be empty
  • type may not be empty
⚠️

Commit 4011e45757ba3d6fecfaf6cc1690a8fa3bd33039 has a message "Linting, Fixes, and Test" giving 2 errors:

  • subject may not be empty
  • type may not be empty
⚠️

Commit cdb5242669d9f85912b1982e82c784268384450d has a message "refactor: Resolved Merge Conflicts

Rebased with master to resolve existing merge conflicts

BREAKING CHANGE: Will throw an error on build if there are duplicated image names in the project" giving 1 errors:

  • subject must not be sentence-case, start-case, pascal-case, upper-case
⚠️

Commit 59c3af6eb882defe6a90c17957be104f50104463 has a message "refactor: Bump Warning Message

Changed the warning message from notifying of 8.0.0 to 9.0.0" giving 1 errors:

  • subject must not be sentence-case, start-case, pascal-case, upper-case
Messages
📖
> titanium-mobile@8.3.0 test /Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239
> npm run ios-sanity-check && grunt


> titanium-mobile@8.3.0 ios-sanity-check /Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239
> ./build/scons check-ios-toplevel

Running "eslint:lintOnly" (eslint) task

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239/build/lib/utils.js
331:6   warning  The 'require.resolve.paths' is not supported until Node.js 8.9.0. The configured version range is '>=8'  node/no-unsupported-features/node-builtins
332:20  warning  The 'require.resolve.paths' is not supported until Node.js 8.9.0. The configured version range is '>=8'  node/no-unsupported-features/node-builtins

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239/cli/lib/tasks/process-js-task.js
158:12  warning  Avoid calling back inside of a promise  promise/no-callback-in-promise
165:5   warning  Avoid calling back inside of a promise  promise/no-callback-in-promise

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239/common/Resources/ti.internal/extensions/node/buffer.js
64:5  warning  Missing JSDoc parameter description for 'arg'               valid-jsdoc
65:5  warning  Missing JSDoc parameter description for 'encodingOrOffset'  valid-jsdoc
66:5  warning  Missing JSDoc parameter description for 'length'            valid-jsdoc

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239/android/cli/commands/_build.js
3303:18  warning  'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead  node/no-deprecated-api

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239/iphone/cli/hooks/frameworks.js
 60:5   warning  Expected catch() or return                       promise/catch-or-return
 60:34  warning  Avoid calling back inside of a promise           promise/no-callback-in-promise
 79:6   warning  Avoid wrapping return values in Promise.resolve  promise/no-return-wrap
425:5   warning  Each then() should return a value or throw       promise/always-return

/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-10239/tests/Resources/ti.ui.imageview.addontest.js
8:11  error  'Ti' is already defined as a built-in global variable  no-redeclare

✖ 13 problems (1 error, 12 warnings)

Warning: Task "eslint:lintOnly" failed.� Use --force to continue.

Aborted due to warnings.
npm ERR! Test failed.  See above for more details.

📖

🚨 This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

Generated by 🚫 dangerJS against 0818153

@sgtcoolguy sgtcoolguy modified the milestones: 8.1.0, 8.2.0 Jun 3, 2019
Copy link
Contributor

@cb1kenobi cb1kenobi left a comment

Choose a reason for hiding this comment

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

I think this ticket is a bad idea and that we should NOT merge it. Please see my comment on the ticket: https://jira.appcelerator.org/browse/TIMOB-25032.

@sgtcoolguy sgtcoolguy modified the milestones: 8.2.0, 8.3.0 Sep 5, 2019
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* global Ti */
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 🚫 tests/Resources/ti.ui.imageview.addontest.js line 8 – 'Ti' is already defined as a built-in global variable. (no-redeclare)

@sgtcoolguy sgtcoolguy removed this from the 8.3.0 milestone Dec 10, 2019
@vijaysingh-axway
Copy link
Contributor

Closing in favor of PR #11437

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.

None yet

7 participants