我们正在为我们的私人项目使用GitLab.有一些来自github的分叉库,我们想要安装为npm模块.直接从npm安装该模块是可以的,例如:
npm install git://github.com/FredyC/grunt-stylus-sprite.git
...也正常工作,但对GitLab做同样的事情,只是更改域名会让我犯这个错误.
npm WARN `git config --get remote.origin.url` returned wrong result (git://git.domain.com/library/grunt-stylus-sprite.git)
npm ERR! git clone git://git.domain.com/library/grunt-stylus-sprite.git Cloning into bare repository 'D:\users\Fredy\AppData\Roaming\npm-cache\_git-remotes\git-git-domain-com-library-grunt-stylus-sprite-git-6f33bc59'...
npm ERR! git clone git://git.domain.com/library/grunt-stylus-sprite.git fatal:unable to connect to git.domain.com:
npm ERR! git clone git://git.domain.com/library/grunt-stylus-sprite.git git.domain.com[0: 77.93.195.214]: errno=No error
npm ERR! Error: Command failed: Cloning into bare repository 'D:\users\Fredy\App
Data\Roaming\npm-cache\_git-remotes\git-git-domain-com-library-grunt-stylus-spr
ite-git-6f33bc59'...
npm ERR! fatal: unable to connect to git.domain.com:
npm ERR! git.domain.com[0: xx.xx.xx.xx]: errno=No error
Run Code Online (Sandbox Code Playgroud)
从GitLab的Web界面,我有这个URL
git@git.domain.com:library/grunt-stylus-sprite.git.针对npm install它运行此尝试git从npm注册表安装模块. …
尽管我很喜欢 Cypress,但结果却开始变得很糟糕。我不认为我会做一些根本错误的事情。我已经阅读了几次最佳实践,但我看不出我可以真正改进什么。
它开始变得相当令人沮丧。让测试在本地机器上完美运行(尝试连续运行多次),但是当相同的代码通过 CI(当前是 Bitbucket Pipelines)运行时,一些测试由于奇怪的原因而失败。
例如,单击列表中的一个项目会在购物车中添加一个项目。工作完美,但我试图打破它,但由于某种原因,CI 中的相同测试使点击发生两次。这是我至少能够描述的一个问题。其他人不正常,并且经常随机发生,就像该元素不可见,但查看屏幕截图我可以看到就好了。
我尝试使用cypress-failed-log插件来查看命令日志,但这并没有真正的帮助,因为它与我在本地看到的相同,但在 CI 中却失败了。我在 Cypress Dashboard 中看到的视频也没有那么有用,因为它通常太快了,有些东西甚至在那里看不到。
有人可以就如何更优雅地处理手头的问题向我建议一些其他选择吗?我必须承认我即将放弃这些测试,因为让它们变得可靠需要太多时间。
关于我的设置的一些细节:
cypress-failed-log@2.5.0
cypress-testing-library@3.0.1
cypress@3.3.1
# job definition for running E2E tests in parallel
e2e: &e2e
name: E2E tests
image: cypress/browsers:chrome67-ff57
caches:
- yarn
- home-cache
script:
- yarn -v
- cd cypress
- yarn install --frozen-lockfile
- npx @bahmutov/print-env BITBUCKET
- yarn ci --parallel --ci-build-id $BITBUCKET_BUILD_NUMBER
Run Code Online (Sandbox Code Playgroud) 通常的场景.我希望有一些解耦的代码,即在某些东西准备就绪时触发事件.对于整个应用程序运行,这只会发生一次.
另一方面,还有另一段代码,我想在触发两个或多个事件时发生其他事情.我的意思是像所有这些,如依赖.
好吧,更多异步的东西在一起...绝对承诺对吗?
然后我开始思考.使用pub/sub进行一次性活动真的很明智吗?仅仅制定可接受的承诺,一旦该事件即将被触发,就会解决这个问题会更好吗?但是,这意味着我需要将解耦代码相互连接起来.有一件事是共享EventEmitter,但依赖于某些代码来实际创建承诺...听起来相当糟糕.
所以我在考虑某种混合.有模块,其他模块可以通过它的名称请求"事件"并获得准备好的Promise对象.然后,其他模块应该触发该事件并以这种方式有效地完成/拒绝该事件.
var promisedLand = require('./promisedLand');
promisedLand.waitFor('event'); // returns promise
promisedLand.resolve('event', value);
promisedLand.reject('event', error);
Run Code Online (Sandbox Code Playgroud)
您对此解决方案有何看法?有机会有这样的解决方案吗?
我很困惑为什么这不起作用,我得到了 Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
var crypto = require('crypto');
var key = "ciw7p02f70000ysjon7gztjn7";
var pt = "72721827b4b4ee493ac09c635827c15ce014c3c3";
var encrypt = crypto.createCipher('aes256', key);
encrypt.update(pt, 'utf8', 'hex');
var encrypted = encrypt.final('hex')
var decrypt = crypto.createDecipher('aes256', key);
decrypt.update(encrypted, 'hex', 'utf8')
decrypt.final()
Run Code Online (Sandbox Code Playgroud)
工作解决方案: https ://runkit.com/fredyc/symmetric-encryption-with-nodejs
我有几个与 Cloud Firestore 交互的 Cloud Functions。我已经成功启动了两个模拟器(firebase emulators:start --only functions,firestore)并且我运行了请求并且它起作用了。然而,模拟函数的 URL 相当长......
http://localhost:5001/my-app/us-central1/myFunc
我想要么获得一个完整的网址,要么以某种方式组装它。my-app理论上可以从指定.firebaserc默认值的位置读取。但是,我不确定港口或地区。
unit-testing firebase google-cloud-functions google-cloud-firestore firebase-cli
我们在我们的应用程序中使用Qooxdoo框架.目前,它的副本存储在根文件夹"qooxdoo"中的Git存储库中.我们决定将子模块直接替换为GitHub Qooxdoo存储库,因此我们可以更容易地检查新版本.
我基于master创建了这些更改的分支,称为qooxdoo-update.完全删除旧文件夹并为qooxdoo添加了子模块.
git rm -r qooxdoo
git submodule add git://github.com/qooxdoo/qooxdoo.git qooxdoo
到目前为止,这非常好.但是当我想将master合并到这个分支以保持更新直到其他开发人员可以测试他们的代码而不是新版本时出现问题.
在qooxdoo-update分支中我发出命令:
git merge origin/master
CONFLICT(文件/目录):在origin/master中有一个名为qooxdoo的目录.添加qooxdoo作为qooxdoo~HEAD
然后...
git status未
合并路径:(根据需要使用"git add/rm ..."来标记分辨率)Run Code Online (Sandbox Code Playgroud)added by us: qooxdoo
运行...
git rm qooxdoo
qooxdoo:需要合并
rm'qooxdoo'
文件'qooxdoo' 的取消链接失败.我应该再试一次吗?(Y/N)
要么...
git add qooxdoo
错误:无法索引文件qooxdoo
致命:更新文件失败
所以我不确定如何解决冲突以成功完成合并.
我不确定这是否纯粹是 Windows 问题。我没有选择在其他地方进行测试。鉴于这个非常简单的代码(Coffeescript):
console.log('Calling console.log')
console.error('Calling console.error')
console.log('Calling console.log second time - fails')
console.error('Calling console.error second time - fails')
nonexisting.throwError()
Run Code Online (Sandbox Code Playgroud)
直接用它运行coffee app.coffee它效果很好,我得到了这个:
Calling console.log
Calling console.error
Calling console.log second time - fails
Calling console.error second time - fails
ReferenceError: nonexisting is not defined
....
Run Code Online (Sandbox Code Playgroud)
然而跑步nodemon app.coffee给了我这样的结果:
17 Mar 20:38:56 - [nodemon] starting `coffee.cmd server.coffee`
Calling console.log
Calling console.error
17 Mar 20:38:56 - [nodemon] app crashed - waiting for file changes before starting...
Run Code Online (Sandbox Code Playgroud)
不仅根本没有异常信息,而且后面的日志消息也因为某种原因被吞掉了。在更复杂的情况下,我没有办法真正找到崩溃的原因。我尝试调试,但一切似乎都很好,调用了 console.log/error ,但由于某种原因它没有显示。异常被 Coffeescript …
我是一个 Windows 用户,所以我完全不知道我在这里做什么。我无法真正运行 XCode。我正在使用 Microsoft Mobile Center 为我进行构建。它经历了整个编译,但最终失败并出现此错误消息。
\n\n\xe2\x96\xb8 Compiling LaunchScreen.storyboard\n** ARCHIVE FAILED **\n\nThe following build commands failed:\n CompileAssetCatalog /Users/ci/Library/Developer/Xcode/DerivedData/tracker-alpha-ftjoguutzpnihlgvuldnwyyqxjbe/Build/Intermediates/ArchiveIntermediates/tracker-alpha/InstallationBuildProductsLocation/Applications/tracker-alpha.app tracker-alpha/Assets.xcassets\n(1 failure)\n##[error]Error: /usr/bin/xcodebuild failed with return code: 65\nRun Code Online (Sandbox Code Playgroud)\n\n这是一个基本的 React Native 应用程序,没有自定义代码,只是在将 CRNA 分离到 ExpoKit后尝试编译。您可以在此处的公共存储库中查看整个应用程序:https ://bitbucket.org/fredyc/tracker/src/f090e39c499204eaf629e4f13dd0f873dae2846e/ios/?at=ios
\n\n如果有人可以尝试在真正的 XCode 中编译它,它可能会揭示更多信息。无论如何,这里是 Mobile Center 生成的详细日志(如果它能以某种方式提供帮助的话):https://pastebin.com/9CVrfBRJ
\n我需要一些帮助来弄清楚订阅和实时更新的一般方法是什么。我有一个 React Native 应用程序,并使用 Apollo 和 Graphcool 服务作为后端。
在某些情况下,查看应用程序的用户会收到推送通知,告知某些内容已发生更改。当然,屏幕数据也应该更新。订阅显然是这项工作的候选者,我基本上让它发挥了作用。
我有一个像这样的订阅,它本身工作得很好(用于在谷歌地图上定位玩家头像)。
subscription PlayerMap($gameId: ID) {
Game(filter: { mutation_in: [CREATED, UPDATED], node: { id: $gameId } }) {
node {
players {
id
character {
id
name
}
user {
id
latitude
longitude
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后有一个不同的应用程序屏幕createPlayer与refetchQueriesApollo 一起执行突变(为了简单起见),它运行此查询来更新内容。
query GameCharacters($gameId: ID!) {
Game(id: $gameId) {
players {
id
character {
id
name
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
现在,当此操作完成时,订阅查询(在另一个屏幕上仍然处于活动状态)也会更新,但由于某种原因,对象Game中缺少整个节点data。
为了处理订阅,我有一个这样的组件。
class Subscriber extends Component<void, …Run Code Online (Sandbox Code Playgroud) 首次尝试设置 Firebase Cloud Messaging。在 Web 应用程序指南中,有一个关于使用 监视注册令牌刷新的部分onTokenRefresh。
https://firebase.google.com/docs/cloud-messaging/js/client?authuser=0#access_the_registration_token
但是,在查看参考文档时,我发现此方法已被弃用。
https://firebase.google.com/docs/reference/js/firebase.messaging.Messaging?authuser=0#ontokenrefresh
不需要处理令牌轮换是什么意思?令牌是getToken永久获得的吗?它不是标准的 JWT 令牌,因此如果存在某种过期情况,我无法解密。
javascript ×5
firebase ×2
git ×2
node.js ×2
coffeescript ×1
cypress ×1
e2e-testing ×1
encryption ×1
events ×1
expo ×1
firebase-cli ×1
git-merge ×1
gitlab ×1
graphcool ×1
graphql ×1
ios ×1
nodemon ×1
npm ×1
promise ×1
react-apollo ×1
react-native ×1
reactjs ×1
unit-testing ×1
xcode ×1