小编Cha*_*nna的帖子

Azure 管道不允许 git push 需要抛出“GenericContribute”权限

我正在尝试使用cmd组件推送在 Azure 管道期间完成的一些更改,如下所示,

steps:
- script: |
   git config user.email you@you.com
   git config user.name "your name"
   git diff
   git  add .
   git commit -m "version update [skip ci]"
   git push origin HEAD:master
Run Code Online (Sandbox Code Playgroud)

但它无法显示以下错误。

远程:0000000000aaTF41027:您需要 Git 'GenericContribute' 权限才能执行此操作。详细信息:身份'Build\sdfdfjjkk',范围'repository'

我已经设置了必要的权限如下:

在此处输入图片说明

并且Allow scripts to access the OAuth token还启用了此处提到的

我还需要哪些其他权限才能使其工作?

git azure-devops azure-pipelines-build-task azure-pipelines

23
推荐指数
3
解决办法
2万
查看次数

拒绝访问。需要使用池默认权限来执行操作

尝试在 Azure 开发人员上保存发布管道时出现以下错误。我需要从管理员那里获得哪些确切的权限?

Access denied. <<user id>> needs Use permissions for pool Default to perform the action. For more information, contact the Azure DevOps Server administrator.
Run Code Online (Sandbox Code Playgroud)

azure-devops azure-pipelines-release-pipeline azure-aks

8
推荐指数
3
解决办法
8037
查看次数

如何查找违反唯一键约束的记录?

假设我有两个表如下,

表A.

    +-------+-------+-------+-------+
    | col_a | col_b | col_c | col_d |
    +-------+-------+-------+-------+
    |       |       |       |       |
    +-------+-------+-------+-------+
Run Code Online (Sandbox Code Playgroud)

表B.

    +-------+-------+-------+-------+
    | col_a | col_b | col_c | col_d |
    +-------+-------+-------+-------+
    |       |       |       |       |
    +-------+-------+-------+-------+
Run Code Online (Sandbox Code Playgroud)

我将使用表B更新表A.以下是条件

  1. 等于的记录col_a应在表A中更新
  2. 记录不等于col_a应插入表A
  3. 表A具有唯一的键约束(col_b,col_c,col_d)

问题是当更新表A中的数据时,对于某些记录,此唯一键约束失败.问题是如何使用查询识别违反唯一键约束的记录.(我无权访问日志)

sql oracle

7
推荐指数
1
解决办法
7508
查看次数

Mongodb如果不存在,如何插入(如果存在则不更新)?

如果文档不存在而不更新现有文档(如果存在),如何插入文档?

假设我有一份文件如下:

  {
          "company":"test", 
          "name":"nameVal"
}
Run Code Online (Sandbox Code Playgroud)

我想检查集合是否包含公司test,如果它不存在我想创建一个新文档.如果它存在我想做什么都没有.我试过updateupsert = true.但它会更新现有文档(如果存在).

这是我试过的:

db.getCollection('companies').update(
    {
  "company": "test"
  },
  {
  "company": "test",
  "name": "nameVal2"
},
{upsert:true}
)
Run Code Online (Sandbox Code Playgroud)

感谢使用一个查询解决此问题的任何帮助.

mongodb

7
推荐指数
1
解决办法
4380
查看次数

在命令中查询必须针对单个分片键

我正在尝试使用具有分片键的Mongo Api将多个文档插入Cosmos DB,如下所示:

insertAll(trips.stream().map(t -> Document.parse(gson.toJson(t))).collect(Collectors.toList()),"trip");
Run Code Online (Sandbox Code Playgroud)

insertAll方法如下,

private void insertAll(List<Document> data, String collectionName) {
        MongoCollection<Document> collection = mongoTemplate.getCollection(collectionName);
        collection.insertMany(data);
    }
Run Code Online (Sandbox Code Playgroud)

我要插入的文档如下,

Document{{sensorId=b827ebe942b7, liftId=1edb945b-29e7-c6c7-d20b-87c0, timestamp=1554902007838, .......}}
Run Code Online (Sandbox Code Playgroud)

即使我提供了分片密钥,但我还是liftId得到了一个例外,说必须提供单个分片密钥。

Command failed with error 61: 'query in command must target a single shard key' on server cdb-ms-prod-southeastasia1-fd10.documents.azure.com:10255. 
    The full response is { "_t" : "OKMongoResponse", "ok" : 0, "code" : 61, "errmsg" : "query in command must target a single shard key", "$err" : "query in command must target a single shard …
Run Code Online (Sandbox Code Playgroud)

sharding spring-data-mongodb azure-cosmosdb azure-cosmosdb-mongoapi

6
推荐指数
0
解决办法
950
查看次数

访问chrome net :: ERR_INSECURE_RESPONSE中的localhost api时出错

我试图使用angular $ resourses访问在localhost中运行的api,chrome console给出了错误说ERR_INSECURE_RESPONSE.

我尝试在Chrome中禁用网络安全性.还是一样的错误.这是我使用的角度工厂.如何绕过此错误并测试我的应用.

    ImpactPortal.factory('apiFactory', function ($resource) {
    return $resource('https://localhost:8443/mifosng-provider/api/v1/client_impact_portal', {}, {
        query: {
            method: 'GET',
            params: {},
            isArray: true
        }
    })
});
Run Code Online (Sandbox Code Playgroud)

google-chrome angularjs angular-resource

3
推荐指数
1
解决办法
1万
查看次数

如何将字符串值添加到nvd3折线图x轴值?

我正在使用nvd3在我的角度js应用程序中创建条形图.这是脚本部分

<script>
        var app = angular.module("nvd3TestApp", ['nvd3ChartDirectives']);

        function ExampleCtrl2($scope){
            $scope.exampleData2 = [
        {
            "key": "Series 1",
             "values": [ 
             ["2004",5],["2005",10],["2006",3],["2007",9],["2008",10],["2009",5]]
        }
    ];

    $scope.xFunction = function(){
    return function(d){
        return d[0];
    };
}

$scope.yFunction = function(){
    return function(d){
        return d[1];
    };
}

        }
    </script>
Run Code Online (Sandbox Code Playgroud)

这是视图div

<div ng-controller="ExampleCtrl2">
    <nvd3-line-chart
        data="exampleData2"
        id="xExample"
        width="550"
        height="300"
        showXAxis="true"
        showYAxis="true"
        x="xFunction()"
        y="yFunction()"
        tooltips="true">
            <svg></svg>
    </nvd3-line-chart>
</div>
Run Code Online (Sandbox Code Playgroud)

如何使用"aaa""bbb"等字符串作为x轴值.如果我用非数字字符串替换"2004",则会出现错误:错误:属性变换的值无效="translate(NaN,0)"

javascript linechart angularjs nvd3.js

3
推荐指数
1
解决办法
9343
查看次数

如何禁用角度P日历中的将来日期?

我使用日历输入如下。

<p-calendar  maxDate="dateTime" showTime="true" hourFormat="12" showButtonBar="true" [(ngModel)]="dateTime" name="timeOfUse" required #timeOfUse="ngModel">
          </p-calendar>
Run Code Online (Sandbox Code Playgroud)

我想在此日期选择器中禁用将来的日期。它可能是一个简单的属性,但我无法弄清楚。感谢任何帮助

primeng angular

3
推荐指数
1
解决办法
6657
查看次数

设置活动的标题栏名称

我正在尝试更改我的应用程序活动菜单栏标题.我设法改变字体如下.任何人都可以帮我改变标题的名称.它可能只是一行,但我无法弄清楚.

int actionBarTitle = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
    TextView actionBarTitleView = (TextView) getWindow().findViewById(actionBarTitle);
    if(actionBarTitleView != null){
        actionBarTitleView.setTypeface(typeFace);
    }
Run Code Online (Sandbox Code Playgroud)

android android-titlebar custom-titlebar

2
推荐指数
1
解决办法
1万
查看次数

Java摆动应用程序在~HiDpi~计算机中太小了

我有一个使用java swing的java桌面应用程序,它可以正常显示.

但是当来到~hiDpi~显示器(3200*1800)时整个应用程序太小了.

由于应用程序代码非常庞大且复杂,因此很难重新排列代码以匹配hi dpi.有这个问题的解决方案吗?

我已经看到像IntelliJ想法这样的应用程序,并且eclipse可以很好地使用这种显示而没有问题.感谢任何帮助.

java swing intellij-idea hdpi

2
推荐指数
1
解决办法
4731
查看次数

如何在 git 的属性文件中使用管道变量

在 Azure 管道中,我下载了 kubernetes deployment.yml 属性文件,其中包含以下内容。

spec:
  imagePullSecrets:
  - name: some-secret
  containers:
  - name: container-name
    image: pathtoimage/data-processor:$(releaseVersion)
    imagePullPolicy: Always
    ports:
    - containerPort: 8088
    env:
Run Code Online (Sandbox Code Playgroud)

我的目的是从管道变量中获取值$(releaseVersion)。但似乎kubernetes任务不允许从管道变量访问这个值。

我尝试使用内联配置类型并且它有效。这意味着如果我将与内联内容相同的配置复制到kubernetes任务配置,它就可以工作。

无论如何,我可以使它适用于文件中的配置吗?

kubernetes azure-devops azure-pipelines azure-pipelines-release-pipeline azure-aks

2
推荐指数
1
解决办法
1128
查看次数

如何使用命令行任务将 Azure Pipeline 变量打印到文件?

我在 Azure 构建管道中使用命令行任务在文本文件中附加上次提交消息的列表。

但是当尝试将管道变量值获取到文本文件时,它会打印奇怪的内容(我的项目中的文件名)而不是变量值。我的语法正确吗?

echo *** Version $(versionnumber) ***>> Release_Notes.txt
Run Code Online (Sandbox Code Playgroud)

代理池是Hosted Ubuntu 1604

azure-devops azure-pipelines

2
推荐指数
1
解决办法
2909
查看次数